-
Notifications
You must be signed in to change notification settings - Fork 4
/
AirTransportT3.cpp
123 lines (101 loc) · 3.82 KB
/
AirTransportT3.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#include "AirTransportT3.h" // class implemented
using namespace std;
// File scope starts here
/////////////////////////////// PUBLIC ///////////////////////////////////////
//============================= LIFECYCLE ====================================
// AirTransport Default+Overloaded Constructor
AirTransport::AirTransport(int aWeight, int aCapacity, int aSpeed, const string& aAircraftType, const string& aAircraftName) : mAircraftType(aAircraftType), mAircraftName(aAircraftName), Transport(aWeight, aCapacity, aSpeed) {
this->SetAirTransport(aAircraftType, aAircraftName);
}
// end AirTransport constructor
//============================= ACESS ===================================
// function that sets Weight
void AirTransport::SetWeight(int aWeight) {
Transport::SetWeight(aWeight);
}
// end function SetWeight
// function that sets Capacity
void AirTransport::SetCapacity(int aCapacity) {
Transport::SetCapacity(aCapacity);
}
// end function SetCapacity
// function that sets Speed
void AirTransport::SetSpeed(int aSpeed) {
Transport::SetSpeed(aSpeed);
}
// end function SetSpeed
// function that sets Transport
void AirTransport::SetTransport(int aWeight, int aCapacity, int aSpeed) {
Transport::SetTransport(aWeight, aCapacity, aSpeed);
}
// end function SetTransport
// Overloaded function that sets Transport
void AirTransport::SetTransport(const Transport& aTransport) {
Transport::SetTransport(aTransport);
}
// end function SetTransport
// function that sets type of Aircraft
void AirTransport::SetAircraftType(const string& aAircraftType) {
this->mAircraftType = aAircraftType;
}
// end function SetAircraftType
// function that sets name of Aircraft
void AirTransport::SetAircraftName(const string& aAircraftName) {
this->mAircraftName = aAircraftName;
}
// end function SetAircraftName
// function that sets AirTransport
void AirTransport::SetAirTransport(int aWeight, int aCapacity, int aSpeed, const string& aAircraftType, const string& aAircraftName) {
this->SetWeight(aWeight);
this->SetCapacity(aCapacity);
this->SetSpeed(aSpeed);
this->SetAircraftType(aAircraftType);
this->SetAircraftName(aAircraftName);
}
// end function SetAirTransport
// Overloaded function that sets AirTransport
void AirTransport::SetAirTransport(const string& aAircraftType, const string& aAircraftName) {
this->SetAircraftType(aAircraftType);
this->SetAircraftName(aAircraftName);
}
// end function SetAirTransport
// Overloaded function that sets AirTransport
void AirTransport::SetAirTransport(const AirTransport& aAirTransport) {
this->SetAirTransport(aAirTransport.GetWeight(), aAirTransport.GetCapacity(), aAirTransport.GetSpeed(), aAirTransport.GetAircraftType(), aAirTransport.GetAircraftName());
}
// end function SetAirTransport
// function that gets Weight
int AirTransport::GetWeight() const {
return Transport::GetWeight();
}
// end function GetWeight
// function that gets Capacity
int AirTransport::GetCapacity() const {
return Transport::GetCapacity();
}
// end function GetCapacity
// function that gets Speed
int AirTransport::GetSpeed() const {
return Transport::GetSpeed();
}
// end function GetSpeed
// function that gets the Transport
const Transport& AirTransport::GetTransport()const {
return Transport::GetTransport();
}
// end function GetTransport
// function that gets type of Aircraft
const string& AirTransport::GetAircraftType() const {
return this->mAircraftType;
}
// end function GetAircraftType
// function that gets name of Aircraft
const string& AirTransport::GetAircraftName() const {
return this->mAircraftName;
}
// end function GetAircraftType
// function that gets the AirTransport
const AirTransport& AirTransport::GetAirTransport()const {
return *this;
}
// end function GetAirTransport