-
Notifications
You must be signed in to change notification settings - Fork 23
/
10.Ex1 PlatypusConstructorOrder.cpp
79 lines (70 loc) · 1.11 KB
/
10.Ex1 PlatypusConstructorOrder.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#include <iostream>
using namespace std;
class Mammal
{
public:
void FeedBabyMilk()
{
cout << "Mammal: Baby says glug!" << endl;
}
Mammal()
{
cout << "Mammal: Contructor" << endl;
}
~Mammal()
{
cout << "Mammal: Destructor" << endl;
}
};
class Reptile
{
public:
void SpitVenom()
{
cout << "Reptile: Shoo enemy! Spits venom!" << endl;
}
Reptile()
{
cout << "Reptile: Contructor" << endl;
}
~Reptile()
{
cout << "Reptile: Destructor" << endl;
}
};
class Bird
{
public:
void LayEggs()
{
cout << "Bird: Laid my eggs, am lighter now!" << endl;
}
Bird()
{
cout << "Bird: Contructor" << endl;
}
~Bird()
{
cout << "Bird: Destructor" << endl;
}
};
class Platypus: public Mammal, public Bird, public Reptile
{
public:
Platypus()
{
cout << "Platypus: Contructor" << endl;
}
~Platypus()
{
cout << "Platypus: Destructor" << endl;
}
};
int main()
{
Platypus realFreak;
//realFreak.LayEggs();
//realFreak.FeedBabyMilk();
//realFreak.SpitVenom();
return 0;
}