-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlight.cpp
executable file
·59 lines (57 loc) · 1.54 KB
/
Flight.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
#include "Flight.h"
using std::cout;
using std::endl;
Flight::Flight() {
this->FlightPath = "";
this->cost = 0.0;
this->time = 0;
this->airline = "";
}
Flight::Flight(DSString headCity) {
this->FlightPath = headCity;
this->cost = 0.0;
this->time = 0;
this->airline = "";
}
Flight::Flight(DSString FlightPath, float cost, int time, DSString airline) {
this->FlightPath = FlightPath;
this->cost = cost;
this->time = time;
this->airline = airline;
}
bool Flight::operator==(const Flight &rhs) const {
if (this->FlightPath == rhs.getFlightPath() && this->time == rhs.getTime() && this->cost == rhs.getCost() && this->airline == rhs.getAirline()) {
return true;
}
else return false;
}
DSString Flight::getFlightPath() const {
return this->FlightPath;
}
float Flight::getCost() const {
return this->cost;
}
int Flight::getTime() const {
return this->time;
}
DSString Flight::getAirline() const {
return this->airline;
}
void Flight::setFlightPath(DSString newFlightPath) {
this->FlightPath = newFlightPath;
}
void Flight::setCost(float newCost) {
this->cost = newCost;
}
void Flight::setTime(int newTime) {
this->time = newTime;
}
void Flight::setAirline(DSString newAirline) {
this->airline = newAirline;
}
void Flight::printFlight() {
cout << "To: " << this->FlightPath << endl;
cout << "Cost: " << this->cost << endl;
cout << "Time: " << this->time << endl;
cout << "Airline: " << this->airline << endl;
}