Write a  C++ 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). 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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a  C++ 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). 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<algorithm>

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.

 

 

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). 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.
LaunchController
LandingController
- launchHourt: int
- launchHour2: Int
- launchMin1: int
- landHour1: int
- landHour2: int
- landMin1: int
- landMin2: int
- launchMin2: int
+ launchSchedule(FlightSchedule" ): void
+ landingSchedule(FlightSchedule" ): void
Extends
Extends
FlightController
4 flight_schedule FlightSchedule
+ FlightController()
+ flights: FlightSchedule
Flight
- flghtName: string
- launchHour: int
- launchMin: Int
- landHour: int
- landMin: int
FlightSchedule
- duration: int
+ flights Flight
- state: string
+ method(type): type
+ getlaunchHour) int
+ getLaunchMin(): int
+ getlandHour(): int
+ getlandMin) int
+ getState(): string
+ setState(string): void
+ calculatelanding(): void
Transcribed Image Text: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). 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. LaunchController LandingController - launchHourt: int - launchHour2: Int - launchMin1: int - landHour1: int - landHour2: int - landMin1: int - landMin2: int - launchMin2: int + launchSchedule(FlightSchedule" ): void + landingSchedule(FlightSchedule" ): void Extends Extends FlightController 4 flight_schedule FlightSchedule + FlightController() + flights: FlightSchedule Flight - flghtName: string - launchHour: int - launchMin: Int - landHour: int - landMin: int FlightSchedule - duration: int + flights Flight - state: string + method(type): type + getlaunchHour) int + getLaunchMin(): int + getlandHour(): int + getlandMin) int + getState(): string + setState(string): void + calculatelanding(): void
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: 15e
Enter the name of the flight: Almanya-Kolombiya
Enter the departure time of the plane: 05 00
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 : 40F1light 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: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: 15e Enter the name of the flight: Almanya-Kolombiya Enter the departure time of the plane: 05 00 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 : 40F1light 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
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY