Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Glider
- {
- public:
- string model; // модель
- string constructor; // конструктор
- string year; // год разработки
- Glider(string m, string c, string y)
- {
- model = m;
- constructor = c;
- year = y;
- }
- void show()
- {
- cout << "<<----GLIDER---->>" << endl;
- cout << "Model: " << model << endl;
- cout << "Constructor: " << constructor << endl;
- cout << "Year of development: " << year << endl;
- }
- };
- class Airplane : public Glider
- {
- public:
- string speed; // скорость
- string range; // дальность полета
- Airplane(string m, string c, string y, string s, string r)
- : Glider(m, c, y), speed(s), range(r)
- {
- model = m;
- constructor = c;
- year = y;
- speed = s;
- range = r;
- }
- void show()
- {
- cout << "<<----AIRPLANE---->>" << endl;
- cout << "Model: " << model << endl;
- cout << "Constructor: " << constructor << endl;
- cout << "Year of development: " << year << endl;
- cout << "Speed: " << speed << endl;
- cout << "Flight range: " << range << endl;
- }
- };
- class Missile : public Airplane
- {
- public:
- string purpose; // назначение
- string fuel; // тип топлива
- Missile(string m, string c, string y, string s, string r, string p, string f)
- : Airplane(m, c, y, s, r), purpose(p), fuel(f)
- {
- model = m;
- constructor = c;
- year = y;
- speed = s;
- range = r;
- purpose = p;
- fuel = f;
- }
- void show()
- {
- cout << "<<----MISSILE---->>" << endl;
- cout << "Model: " << model << endl;
- cout << "Constructor: " << constructor << endl;
- cout << "Year of development: " << year << endl;
- cout << "Speed: " << speed << endl;
- cout << "Flight range: " << range << endl;
- cout << "Purpose: " << purpose << endl;
- cout << "Type of fuel: " << fuel << endl;
- }
- };
- int main()
- {
- Glider G1("Perlan 2", "Airbus", "2018");
- Airplane A1("Foxhound", "A. B. Anosovich", "1970s", "920 km/h", "2240 km");
- Missile M1("Phase III Proton Breeze M", "GKNPTS named after M.V. Khrunichev", "2012", "1500 m/s", "65000 km", "Launch vehicle", "Amyl, Heptyl");
- G1.show();
- A1.show();
- M1.show();
- return 0;
- }
Add Comment
Please, Sign In to add comment