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...


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.



_________________________________________________________________


//i need more explanations :(


#include
#include
using namespace std;
class flight{
protected:
string flight_name;
int launch_hour;
int launch_min;
int land_hour;
int land_min;
int duration;
string state;
public:
flight(string state="Idle"){
this->state=state;
}
void check();
int get_launch_hour();
int get_launch_min();
int get_land_hour();
int get_land_min();
int get_duration();
string get_state();
void set_state(string);
void set_duration(int);
void calculate_landing();
};
int flight::get_duration(){
return duration;
}
void flight::set_duration(int a){
duration=a;
}
int flight::get_launch_hour(){
return launch_hour;
}
int flight::get_launch_min(){
return launch_min;
}
int flight::get_land_hour(){
return land_hour;
}
int flight::get_land_min(){
return land_min;
}
string flight::get_state(){
return state;
}
void flight::set_state(string s){
state=s;
}
void flight::calculate_landing(){
int time;
launch_hour*=60;
time=duration+launch_hour+launch_min;//time=610
land_hour=time/60;//land hour=10
land_min=time-land_hour*60;
launch_hour/=60;
}
void flight::check(){
}
class flight_schedule:public flight{


};
class flight_controller:public flight_schedule{
};
class launch_controller:public flight_controller{
protected:
int launch_hour;
int launch_min;
int launch_hour1;
int launch_min1;
public:
};
class landing_controller:public flight_controller{
protected:
int land_hour;
int land_min;
int land_hour1;
int land_min1;
public:
};
int main(){
flight_schedule *ft[3]={new flight_schedule,new flight_schedule,new flight_schedule};
for( int i=0 ; i<3; i++="">
{
cout<"enter the="" name="" of="" the="" flight:="">
ft[i].get_state();
cout<"enter the="" departure="" time="" of="" the="">
ft[i].get_launch_hour();
ft[i].get_launch_min();
cout<"enter the="" duration="" of="" the="" flight="" in="">
ft[i].get_duration();
cout<><>
}
}


cmpe225_hw1 (1).pdf<br>5 / 6<br>159%<br>+<br>Tam ekrandan çıkmak için F11 tuşuna basın<br>Example Outputs<br>Output 1<br>Enter the name of the flight: A<br>Enter the departure time of the plane: 10 10<br>Enter the duration of the flight in minutes: 70<br>Enter the name of the flight: B<br>Enter the departure time of the plane: 10 20<br>Enter the duration of the flight in minutes: 15<br>Enter the name of the flight: C<br>Enter the departure time of the plane: 11 25<br>Enter the duration of the flight in minutes: 90<br>Launch Order<br>A Launch at 10 : 10 Flight State: IDLE<br>B Launch at 10 : 20<br>C Launch at 11 : 25 Flight State: IDLE<br>Flight State: IDLE<br>Landing Order<br>B Landing at 10 : 35Flight State: IDLE<br>A Landing at 11 : 20Flight State: IDLE<br>C Landing at 12 : 55Flight State: IDLE<br>Process exited after 24.81 seconds with return value e<br>Press any key to continue<br>

Extracted text: cmpe225_hw1 (1).pdf 5 / 6 159% + Tam ekrandan çıkmak için F11 tuşuna basın 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 Enter 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 C Launch at 11 : 25 Flight State: IDLE 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
cmpe225_hw1 (1).pdf<br>2 / 6<br>135%<br>+<br>Assignment<br>Write a program that will track certain information about the flights of aircrafts. You<br>will create your program by referencing the structure given in the diagram (1). Class<br>definitions, access specifiers, data members and member functions in your program must be<br>coherent with the diagram. Certain essential variables for operations such as loops, flag<br>values, counts etc. are not given in the diagram therefore you can define them as your own<br>extra variables in the program.<br>LaunchController<br>LandingController<br>-launchHour1: int<br>- launchHour2: int<br>- launchMin1: int<br>landHour1: int<br>- landHour2: int<br>- landMin1: int<br>- launchMin2: int<br>landMin2: int<br>+ launchSchedule(FlightSchedule

Extracted text: cmpe225_hw1 (1).pdf 2 / 6 135% + 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 -launchHour1: int - launchHour2: int - launchMin1: int landHour1: int - landHour2: int - landMin1: int - launchMin2: int landMin2: int + launchSchedule(FlightSchedule" ): void + landingSchedule(FlightSchedule" ): void Extends Extends FlightController # flight_schedule: FlightSchedule + FlightController() + flights: FlightSchedule" Flight |- flightName: 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

Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here