-
Notifications
You must be signed in to change notification settings - Fork 1
/
BMWTScetan.cpp
63 lines (55 loc) · 1.01 KB
/
BMWTScetan.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
using namespace std;
class Vehicle
{
public:
Vehicle()
{
cout << "Vehicle constructor... "<<endl;
}
virtual void Drift()
{
cout << "Drifting!"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
cout <<" || ||"<<endl;
}
};
class Luxury
{
public:
Luxury()
{
cout << "Luxury constructor... "<<endl;
}
virtual void Lux()
{
cout<<"This is luxury car!"<<endl;
}
};
class Bmw:public Vehicle,public Luxury
{
public:
Bmw()
{
cout << "Bmw constructor... "<<endl;
}
void Beep()
{
cout<<"---Beep, beep! Move over, I have 530HP! Wooom, Wooooooom!---"<<endl;
}
};
int main()
{
Vehicle*pCar = new Bmw;
pCar->Drift();
delete pCar;
Bmw*pAuto = new Bmw;
pAuto->Beep();
delete pAuto;
return 0;
}