Professional Documents
Culture Documents
#include <iostream>
#include "DateAndTime.h"
class Flight
string Name_of_airline;
double TicketPrice;
Date date;
Time FlyingTime;
Time LandingTime;
public:
Flight() :TicketPrice(99999999) {
Name_of_airline = airline;
this->TicketPrice = TicketPrice;
Date& getDate() {
return date;
}
Time& getFlyingTime() {
return FlyingTime;
Time& getLandingTime() {
return LandingTime;
date.setYear(y);
date.setMonth(m);
date.setDay(d);
FlyingTime.setHours(h);
FlyingTime.setMinutes(m);
LandingTime.setHours(h);
LandingTime.setMinutes(m);
string get_Name_of_Airline()
return Name_of_airline;
}
double getTicketPrice()
return TicketPrice;
int getDay_of_Flight()
return date.getDay();
int getMonth_of_Flight()
return date.getMonth();
int getYear_of_Flight()
return date.getYear();
int getFlyingTime_Hour()
return FlyingTime.getHours();
int getFlyingTime_Minutes()
return FlyingTime.getMinutes();
}
int get_Total_Air_Time()
int count = 0;
flhour++;
count++;
if (flhour == 24) {
flhour = 0;
return count;
Time get_Total_Air_Time_object()
Time Total_Air_Time;
Total_Air_Time.setHours(abs(LandingTime.getHours() - FlyingTime.getHours()));
Total_Air_Time.setMinutes(abs(LandingTime.getMinutes() -
FlyingTime.getMinutes()));
return Total_Air_Time;
double getTotalFlightTime()
return get_Total_Air_Time_object().getfloatingTime();
int getLandingTime_Hour()
return LandingTime.getHours();
}
int getLandingTime_Minutes()
return LandingTime.getMinutes();
string getDate_string() {
return date.getDate();
string getLandingTime_string() {
return LandingTime.getTime();
string getFlyingTime_string() {
return FlyingTime.getTime();
};
cout << " \t\t\tTicket Price: " << obj.getTicketPrice() << endl;
cout << " \t\t\tDate: " << obj.getDay_of_Flight() << "/" <<
obj.getMonth_of_Flight() << "/" << obj.getYear_of_Flight() << endl;
flhour = true;
flmin = true;
ldmin = true;
else cout << " \t\t\tFlying Time: " << obj.getFlyingTime_Hour() << ":" <<
obj.getFlyingTime_Minutes();
//landing time
else cout << " \t\t\tLanding Time: " << obj.getLandingTime_Hour() << ":" <<
obj.getLandingTime_Minutes();
//duration time
cout << " \t\t\tDuration Time: " << obj.get_Total_Air_Time() << "
hour(s) ";
return output;