Контрольная работа по "Программированию"
Автор: Хамелеон TV • Декабрь 21, 2021 • Практическая работа • 507 Слов (3 Страниц) • 189 Просмотры
#define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <vector>
# include<cstring>
# include <locale.h>
using namespace std;
class CVehicle
{
private: int x, y, year;
float price, speed;
public:
CVehicle(int x, int y, int year, float price, float speed)
{ //constructor CVehicle
this->x = x; this->y = y;
this->year = year;
this->price = price;
this->speed = speed;
}
void get_parametr()
{
setlocale(LC_ALL, "Rus");
cout << "Введите координаты: ";
cin >> x >> y;
cout << "Координаты:" << this->x << " " << this->y << endl;
cout << "Год" << this->year << endl;
cout << "Цена" << this->price << endl;
cout << "Скорость" << this->speed << endl;
}
};
class CPlane : public CVehicle {
private: unsigned high; unsigned number_of_pasangers;
public:
CPlane(int x, //constructor CPlane
int y,
int year,
float price,
float speed,
unsigned high,
unsigned number_of_pasangers
) :CVehicle(x, y, year, price, speed)
{
this->high = high;
this->number_of_pasangers =
...