Answered step by step
Verified Expert Solution
Question
1 Approved Answer
CoenAir is an airline company that offers domestic and international flights. The company has many flights. A flight is identified by a flight identifier (
CoenAir is an airline company that offers domestic and international flights. The company has many flights. A flight is identified by a flight identifier string a departure city string an arrival city string a departure time an object of class Time see in the class an arrival time object of class Time and the expected duration of the flight in terms of hours int Create a driver to test the functionalities of the class Flight.
Q points Create the class Flight. Include all the attributes, one or multiple constructors, a copy constructor, a destructor, constant member functions, and accessing functions. Note that departure and arrival Time objects must be created using dynamic allocation, ie these should be declared as pointers to class Time. Test the class Flight.
Q points We want to create a class called Airline to represent the CoenAir information. Airline contains the name of the airline company, the address, and a telephone number, an array of all flight objects of question Q The class Airline should have the following functionalities including:
Add a flight
Remove a flight
List all flights
List all flights departing from a given city
List all flights arriving to a certain city
List all flights departing from and arriving to specific cities
Return the number of flights
Q points Create the class Passenger to represent the passengers of CoenAir. A passenger has an id string a name string an address string a telephone number string Create all the necessary functions. Test the class Passenger.
Q points We want to book passengers on flights. To this end, we need create a new class called Booking. A passenger can have many bookings. A booking is for one flight and one flight only. A flight has many bookings. To implement this, we need to modify the class Flight to include
an array of objects of the Booking class. We also need to modify the class Passenger to include an array of objects of Bookings. Finally, we need to create the Booking class, which contains an object Passenger, an object Flight, and a seat number string Submit the new classes Airline, Flight, Passenger, and Booking. Test the entire system.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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