Answered step by step
Verified Expert Solution
Link Copied!

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.
Q1.[20 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, i.e., these should be declared as pointers to class Time. Test the class Flight.
Q2.[30 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 Q1. 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
Q3.[20 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.
Q4.[30 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago