-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFilqht.cpp
123 lines (123 loc) · 3.29 KB
/
Filqht.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"modul.h"
Flight:: Flight()
{
flight_number= "No info";
departure = "No info";
place_of_arrival = "No info";
hour_departure_time = "No info";
hour_arrival_time = "No ingo";
a = 0;
t = 0;
p = 0;
}
Flight::Flight(string flight_number_1, string departure_1, string place_of_arrival_1, string hour_departure_time_1, string hour_arrival_time_1, int a_1, int t_1, int p_1)
{
flight_number = flight_number_1;
departure = departure_1;
place_of_arrival = place_of_arrival_1;
hour_departure_time = hour_departure_time_1;
hour_arrival_time = hour_arrival_time_1;
a = a_1;
t = t_1;
p = p_1;
}
void Flight :: free_tickets_a(){ a = a - 1;}
void Flight :: free_tickets_t(){ t = t - 1;}
void Flight :: free_tickets_p(){ p = p - 1;}
void Flight::Cancel_booking()
{
hour_departure_time = "Sorry, flight postponed";
hour_arrival_time = "Sorry, flight postponed";
a = 0;
t = 0;
p = 0;
}
Flight& Flight::operator =(const Flight& s)
{
flight_number = s.flight_number;
departure = s.departure;
place_of_arrival = s.place_of_arrival;
hour_departure_time = s.hour_departure_time;
hour_arrival_time = s.hour_arrival_time;
a = s.a;
t = s.t;
p = s.p;
return *this;
}
ostream& operator <<(ostream& s, const Flight& b)
{
cout << "Flight number: ";
s << b.flight_number << endl;
cout << "Departure: ";
s << b.departure << endl;
cout << "Place of arrival: ";
s << b.place_of_arrival << endl;
cout << "Hour departupe time: ";
s << b.hour_departure_time <<endl;
cout << "Hour departupe time: ";
s << b.hour_arrival_time << endl;
if ( b.a > 0)
{cout << "Tickets for the car: ";
s << b.a << endl;}
if ( b.t > 0)
{cout << "Tickets for the train: ";
s << b.t << endl;}
if ( b.p > 0)
{cout << "Tickets for the plain: ";
s << b.p << endl;}
cout << endl;
return s;
}
string Flight::Departure_1(){return departure;}
string Flight::Place_of_arrival_1() {return place_of_arrival;}
int Flight::a_c(){ return a;}
int Flight::t_c(){ return t;}
int Flight::p_c(){ return p;}
void Flight :: get_info_a()
{
cout << "Flight number: ";
cout << flight_number << endl;
cout << "Departure: ";
cout << departure << endl;
cout << "Place of arrival: ";
cout << place_of_arrival << endl;
cout << "Hour departupe time: ";
cout << hour_departure_time <<endl;
cout << "Hour departupe time: ";
cout << hour_arrival_time << endl;
cout << "Tickets for the car: ";
cout << a << endl;
cout << endl;
}
void Flight :: get_info_t()
{
cout << "Flight number: ";
cout << flight_number << endl;
cout << "Departure: ";
cout << departure << endl;
cout << "Place of arrival: ";
cout << place_of_arrival << endl;
cout << "Hour departupe time: ";
cout << hour_departure_time <<endl;
cout << "Hour departupe time: ";
cout << hour_arrival_time << endl;
cout << "Tickets for the train: ";
cout << t << endl;
cout << endl;
}
void Flight :: get_info_p()
{
cout << "Flight number: ";
cout << flight_number << endl;
cout << "Departure: ";
cout << departure << endl;
cout << "Place of arrival: ";
cout << place_of_arrival << endl;
cout << "Hour departupe time: ";
cout << hour_departure_time <<endl;
cout << "Hour departupe time: ";
cout << hour_arrival_time << endl;
cout << "Tickets for the plain: ";
cout << p << endl;
cout << endl;
}