Question
C++ Classes and objects Define outside of the class with name Flight the constructor initialising the given parameter values to the regarding attributes and the
C++ Classes and objects
Define outside of the class with name Flight
- the constructor initialising the given parameter values to the regarding attributes and the comment to an empty string.
- the destructor with an output of the flight code.
- the six getter and two setter member functions.
- the function printing flight data formatted in one line like in the examples below, whereas the time given as parameter shall be placed in column scheduled
Code done:
#include
void set_time(int h, int m) { if (h >=0 && m >=0) minutes = m+h*60; else minutes= -1; } int get_hour() { return minutes / 60; } int get_minute() { return minutes % 60; } bool is_valid() { return minutes >=0 ; } };
//4 ostream& operator
//5 class Flight { private: ArrivalDeparture arrivalOrDeparture;
string code, destination, gate, checkIn, comment;
LocalTime expected;
public: Flight(ArrivalDeparture a,string c,string d,string g,string ci, string co = "") { arrivalOrDeparture = a; code = c; destination = d; gate = g; checkIn = ci; comment = co; } ~Flight();
string get_code() { return code; } string get_destination() { return destination; } string get_gate() { return gate; } string get_checkIn() { return checkIn; } string get_comment() { return comment; } LocalTime get_scheduled() { return expected; } void set_expected(LocalTime e) { expected = e; } void set_comment(string c) { comment = c; } bool is_arrival() { return arrivalOrDeparture == arrival; } bool is_departure() { return arrivalOrDeparture == departure; } void print(LocalTime l) { cout
DUSSELDORF AIRPORT ARRIVALS =========================== Flight From LH 2010 Munich EW 9347 Manchester Scheduled Expected Gate Check-in Comments 12:40 13:05 A04 14:50 B04 DUSSELDORF AIRPORT DEPARTURES == = = = = = = == = = = = = = = = = = = = == = = = = = Flight To AF 1307 Paris SU 2537 Moscow EW 9466 London-Heathrow LH 2011 Munich XQ 959 Izmir Scheduled Expected Gate Check-in Comments 09:10 B51 192-194 departed 10:40 031 252-255 boarding 11:15 B35 151-170 13:25 A40 115-120 Code Sharing 14:55 15:20 045 240-242 flight AF 1307 deleted flight SU 2537 deleted flight EW 9466 deleted flight LH 2010 deleted flight LH 2011 deleted flight EW 9347 deleted flight XQ 959 deleted Local Time Flight Airport expected slot 24*60 - minutes : Integer + LocalTime() + void set_time() + get_hour() + get_minute() + is_valid() - name : String + Airport) + -Airport() + schedule() + comment) + delay() + print() zone > TimeZone ACT CET CST EST GMT MSK PST UTC - code : String - destination : String - gate : String - checkin : String - comment; String + Flight() +-Flight + get_code() + get_destination() + get_gate() + get_checkin() + get_comment() + get_expected() + set_comment() + set_expected() + is_arrival() + is_departure() + print() arrivalOrDeparture > ArrivalDeparture arrival departureStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started