Write a program that will track certain information about the flights of aircrafts. You will create your program by referencing the structure given in the diagram (1)(Diagram is attached). Class definitions, access specifiers, data members and member functions in your program must be coherent with the diagram. Certain essential variables for operations such as loops, flag values, counts etc. are not given in the diagram therefore you can define them as your own extra variables in the program Your program will have a class called FlightController that is going to be derived from two base classes which are called LaunchController and LandingController. The FlightController class inherits all accessible data fields and methods from the LandingController and LaunchController classes. Inside the FlightController class, you will define an object of type FlightSchedule which will contain an array of 3 objects of type Flight. In your Flight objects, the constructor of these objects will ask from the user for the inputs of: flight name, launch hour, launch minutes, flight duration. The value of state of the Flight object will be assigned to “Idle” as a default value in the constructor also and you will call the member function within the Flight class which will calculate the landing time for your flight object by using the duration and the launch time. Definition of Flight class will also contain the necessary getters and setters that are given in the diagram and needed throughout your program. In the constructor of your FlightController you will need to define a pointer that will point to the adress of the FlightSchedule object you have created. You will send that pointer into the functions launchSchedule and landingSchedule in your base classes and these functions will perform a sorting operation between these three flight objects. The launchController will check the launch times as in hours and minutes of the array of objects that you have passed as a reference and will sort the array in ascending order. After the sorting you will output the launch order of these flights in order. Similar approach will be taken in the landingController and the landing order will be displayed as output after the sorting is complete. Outputs will consist of flight name, landing hour, landing minute, flight’s state and they will be printed from top down in order. Same thing will hold for both of the landing and launch controllers. Class definitions for both the landingController and the launchController must also contain all of the necessary members and variables in correct access specifiers and expected types. After successfully displaying the ordered ouputs for launches and landing , the program will end.Important Remarks: • You can use the help of swap() function while ordering the landings and launches. This function is contained in the header file of #include • You can use the help of any sorting algorithms your own sorting algorithms, bubble sort etc. To order the array of objects in the launch and flight controllers. Since these controllers are doing their own outputs within their own functions, you can call them one after another in your FlightController’s constructor and each of them will sort the array in their own needs and output regardingly. • You are expected to use the help of passing objects as references, this operators, logical conditions, abilities of inheritance in OOP, any necessary extra calculations etc. during your program. • If there are two or more flights that overlap during the launch or the landing, their states will be changed from the default value of “Idle” to “Delayed”, other values will be printed normally (Outputs should be like in the screenshot)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Assignment
Write a program that will track certain information about the flights of aircrafts. You
will create your program by referencing the structure given in the diagram (1)(Diagram is attached). Class
definitions, access specifiers, data members and member functions in your program must be
coherent with the diagram. Certain essential variables for operations such as loops, flag
values, counts etc. are not given in the diagram therefore you can define them as your own
extra variables in the program

Your program will have a class called FlightController that is going to be derived from two base classes which are called LaunchController and LandingController. The FlightController class inherits all accessible data fields and methods from the LandingController and LaunchController classes. Inside the FlightController class, you will define an object of type FlightSchedule which will contain an array of 3 objects of type Flight. In your Flight objects, the constructor of these objects will ask from the user for the inputs of: flight name, launch hour, launch minutes, flight duration. The value of state of the Flight object will be assigned to “Idle” as a default value in the constructor also and you will call the member function within the Flight class which will calculate the landing time for your flight object by using the duration and the launch time. Definition of Flight class will also contain the necessary getters and setters that are given in the diagram and needed throughout your program. In the constructor of your FlightController you will need to define a pointer that will point to the adress of the FlightSchedule object you have created. You will send that pointer into the functions launchSchedule and landingSchedule in your base classes and these functions will perform a sorting operation between these three flight objects. The launchController will check the launch times as in hours and minutes of the array of objects that you have passed as a reference and will sort the array in ascending order. After the sorting you will output the launch order of these flights in order. Similar approach will be taken in the landingController and the landing order will be displayed as output after the sorting is complete. Outputs will consist of flight name, landing hour, landing minute, flight’s state and they will be printed from top down in order. Same thing will hold for both of the landing and launch controllers. Class definitions for both the landingController and the launchController must also contain all of the necessary members and variables in correct access specifiers and expected types. After successfully displaying the ordered ouputs for launches and landing , the program will end.Important Remarks:

• You can use the help of swap() function while ordering the landings and launches. This function is contained in the header file of #include

• You can use the help of any sorting algorithms your own sorting algorithms, bubble sort etc. To order the array of objects in the launch and flight controllers. Since these controllers are doing their own outputs within their own functions, you can call them one after another in your FlightController’s constructor and each of them will sort the array in their own needs and output regardingly.

• You are expected to use the help of passing objects as references, this operators, logical conditions, abilities of inheritance in OOP, any necessary extra calculations etc. during your program.

• If there are two or more flights that overlap during the launch or the landing, their states will be changed from the default value of “Idle” to “Delayed”, other values will be printed normally

(Outputs should be like in the screenshot)

LaunchController
LandingController
- launchHourt: int
|- launchHour2: Int
|- launchMin1: int
|- launchMin2: int
- landHour1: int
- landHour2: int
- landMin1: int
- landMin2: int
+ launchSchedule(FlightSchedule" ) void
+ landingSchedule(FlightSchedule" ): void
Extends
Extends
FlightController
# flight_schedule: FlightSchedule
+ FlightController()
+ flights: FlightSchedule"
Flight
- fightName: string
- launchHour: int
- launchMin: int
- landHour. Int
- landMin: int
- duration: int
|- state string
FlightSchedule
+ flights: Flight
+ method(type): type
+ getlaunchHour() int
+ getLaunchMin): int
+ getlandHour() int
+ getLandMin() int
+ getState(): string
+ setState(string) void
+ calculatelanding(: vold
Diagram 1
Transcribed Image Text:LaunchController LandingController - launchHourt: int |- launchHour2: Int |- launchMin1: int |- launchMin2: int - landHour1: int - landHour2: int - landMin1: int - landMin2: int + launchSchedule(FlightSchedule" ) void + landingSchedule(FlightSchedule" ): void Extends Extends FlightController # flight_schedule: FlightSchedule + FlightController() + flights: FlightSchedule" Flight - fightName: string - launchHour: int - launchMin: int - landHour. Int - landMin: int - duration: int |- state string FlightSchedule + flights: Flight + method(type): type + getlaunchHour() int + getLaunchMin): int + getlandHour() int + getLandMin() int + getState(): string + setState(string) void + calculatelanding(: vold Diagram 1
Example Outputs
Output 1
Enter the name of the flight: A
Enter the departure time of the plane: 10 10
Enter the duration of the flight in minutes: 70
the name of the flight: B
Enter the departure time of the plane: 10 20
Enter the duration of the flight in minutes: 15
Enter the name of the flight: C
Enter the departure time of the plane: 11 25
Enter the duration of the flight in minutes: 90
Launch Order
A Launch at 10 : 10 Flight State: IDLE
B Launch at 10 : 20 Flight State: IDLE
C Launch at 11 : 25 Flight State: IDLE
Landing Order
B Landing at 10 : 35Flight State: IDLE
A Landing at 11 : 20Flight State: IDLE
C Landing at 12 : 55Flight State: IDLE
Process exited after 24.81 seconds with return value e
Press any key to continue
Output 2
Enter the name of the flight: Fransa-Belçika
Enter the departure time of the plane: 05 30
Enter the duration of the flight in minutes: 70
Enter the name of the flight: Almanya-Hollanda
Enter the departure time of the plane: 4 20
Enter the duration of the flight in minutes: 150
Enter the name of the flight: Almanya-Kolombiya
Enter the departure time of the plane: 05 ee
Enter the duration of the flight in minutes: 100
Launch Order
Almanya-Hollanda Launch at 4 : 20 Flight State: IDLE
Almanya-Kolombiya Launch at 5 : 0 Flight State: IDLE
Fransa-Belçika Launch at 5 : 30 Flight State: IDLE
Landing Order
Almanya-Kolombiya Landing at 6 : 40Flight State: IDLE
Fransa-Belçika Landing at 6: 40Flight State: IDLE
Almanya-Hollanda Landing at 6 : 50Flight State: Delayed
Process exited after 171 seconds with return value e
Press any key to continue
Transcribed Image Text:Example Outputs Output 1 Enter the name of the flight: A Enter the departure time of the plane: 10 10 Enter the duration of the flight in minutes: 70 the name of the flight: B Enter the departure time of the plane: 10 20 Enter the duration of the flight in minutes: 15 Enter the name of the flight: C Enter the departure time of the plane: 11 25 Enter the duration of the flight in minutes: 90 Launch Order A Launch at 10 : 10 Flight State: IDLE B Launch at 10 : 20 Flight State: IDLE C Launch at 11 : 25 Flight State: IDLE Landing Order B Landing at 10 : 35Flight State: IDLE A Landing at 11 : 20Flight State: IDLE C Landing at 12 : 55Flight State: IDLE Process exited after 24.81 seconds with return value e Press any key to continue Output 2 Enter the name of the flight: Fransa-Belçika Enter the departure time of the plane: 05 30 Enter the duration of the flight in minutes: 70 Enter the name of the flight: Almanya-Hollanda Enter the departure time of the plane: 4 20 Enter the duration of the flight in minutes: 150 Enter the name of the flight: Almanya-Kolombiya Enter the departure time of the plane: 05 ee Enter the duration of the flight in minutes: 100 Launch Order Almanya-Hollanda Launch at 4 : 20 Flight State: IDLE Almanya-Kolombiya Launch at 5 : 0 Flight State: IDLE Fransa-Belçika Launch at 5 : 30 Flight State: IDLE Landing Order Almanya-Kolombiya Landing at 6 : 40Flight State: IDLE Fransa-Belçika Landing at 6: 40Flight State: IDLE Almanya-Hollanda Landing at 6 : 50Flight State: Delayed Process exited after 171 seconds with return value e Press any key to continue
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education