@@ -84,6 +84,95 @@ bool Human::getThePresenceOfChildren()
84
84
}
85
85
86
86
87
+ // PASSENGER CLASS
88
+
89
+ // default constructor for the Passenger class
90
+ Passenger::Passenger ()
91
+ {
92
+ this ->setName (" " );
93
+ this ->setSurname (" " );
94
+ this ->setAge (0 );
95
+ this ->setSex (" " );
96
+
97
+ this ->setRoute (" " );
98
+ this ->setLuggage (" " );
99
+ this ->setDepDate (" " );
100
+ this ->setDepAbroadDate (" " );
101
+ };
102
+
103
+ // overloaded constructor for the Passenger class
104
+ Passenger::Passenger (std::string name, std::string surname, int age, std::string sex,
105
+ std::string route, std::string depDate, std::string depAbroadDate, std::string luggage)
106
+ {
107
+ this ->setName (name);
108
+ this ->setSurname (surname);
109
+ this ->setAge (age);
110
+ this ->setSex (sex);
111
+
112
+ this ->setRoute (route);
113
+ this ->setDepDate (depDate);
114
+ this ->setDepAbroadDate (depAbroadDate);
115
+ this ->setLuggage (luggage);
116
+ };
117
+
118
+ // default destructor for the Passenger class
119
+ Passenger::~Passenger (){};
120
+
121
+ // setters for the Passenger class
122
+ void Passenger::setRoute (std::string route)
123
+ {
124
+ this ->route = route;
125
+ }
126
+ void Passenger::setDepDate (std::string date)
127
+ {
128
+ this ->depDate = date;
129
+ }
130
+ void Passenger::setDepAbroadDate (std::string date)
131
+ {
132
+ this ->depAbroadDate = date;
133
+ }
134
+ void Passenger::setLuggage (std::string luggage)
135
+ {
136
+ this ->luggage = luggage;
137
+ }
138
+
139
+ // getters for the Passenger class
140
+ std::string Passenger::getRoute ()
141
+ {
142
+ return route;
143
+ }
144
+
145
+ std::string Passenger::getDepDate ()
146
+ {
147
+ return depDate;
148
+ }
149
+
150
+ std::string Passenger::getDepAbroadDate ()
151
+ {
152
+ return depAbroadDate;
153
+ }
154
+
155
+ std::string Passenger::getLuggage ()
156
+ {
157
+ return luggage;
158
+ }
159
+
160
+ // overloaded output function for Worker class
161
+ void Passenger::outputPass (Passenger &el)
162
+ {
163
+ std::cout << " --------------------------------------------------------------" << std::endl
164
+ << " Name & surname: " << el.getName () << ' '
165
+ << el.getSurname () << std::endl
166
+ << " Age: " << el.getAge () << std::endl
167
+ << " Sex: " << el.getSex () << std::endl
168
+ << " Luggage: " << el.getLuggage () << std::endl
169
+ << " Route: " << el.getRoute () << std::endl
170
+ << " Day of departure: " << el.getDepDate () << std::endl
171
+ << " Day of departure abroad: " << el.getDepAbroadDate () << std::endl
172
+ << " --------------------------------------------------------------" << std::endl;
173
+ }
174
+
175
+
87
176
// WORKER CLASS
88
177
89
178
// default constructor for the Worker class
@@ -383,6 +472,10 @@ void Train::setNumOfHandedTickets(int num)
383
472
{
384
473
this ->numOfHandedTickets = num;
385
474
}
475
+ void Train::setNumOfSoldTickets (int num)
476
+ {
477
+ this ->numOfSoldTickets = num;
478
+ }
386
479
387
480
// getters for the "Locomotive" class
388
481
int Train::getSerialNum ()
@@ -457,6 +550,10 @@ int Train::getNumOfHandedTickets()
457
550
{
458
551
return numOfHandedTickets;
459
552
}
553
+ int Train::getNumOfSoldTickets ()
554
+ {
555
+ return numOfSoldTickets;
556
+ }
460
557
461
558
// output function for the "Locomotive" class
462
559
void Locomotive::outputLoc (Locomotive &el)
@@ -511,7 +608,7 @@ Locomotive::Locomotive(int serialNum, int workspaceNum, int dateOfProd, int maxs
511
608
std::string brand, std::string fuel, int numOfRoutes, int numOfRoutesBeforeRepair,
512
609
int numOfRepair, std::string dateOfComeBack, int daysOnStation, std::string yearOfTechExam,
513
610
std::string routeStatus, std::string routeReason, std::string category, int routeDuration,
514
- std::string route, int numOfHandedTickets)
611
+ std::string route, int numOfSoldTickets, int numOfHandedTickets)
515
612
{
516
613
this ->setSerialNum (serialNum);
517
614
this ->setWorkspaceNum (workspaceNum);
@@ -530,6 +627,7 @@ Locomotive::Locomotive(int serialNum, int workspaceNum, int dateOfProd, int maxs
530
627
this ->setCategory (category);
531
628
this ->setRouteDuration (routeDuration);
532
629
this ->setRoute (route);
630
+ this ->setNumOfSoldTickets (numOfSoldTickets);
533
631
this ->setNumOfHandedTickets (numOfHandedTickets);
534
632
};
535
633
0 commit comments