Add folowing given description to the below given C++ program Description: Add a member function delayFlight(int) in the Flight class to delay the flight by the number of minutes pass as input to this function. (For simplicity, assume that delaying a flight will not change the Date). Add a member function reserveSeat(int) which reserves the number of seats passed as input to this function. Display appropriate message to the user if the seats are not available. Write a main program to test the functionality of your Flight class. Program Code: #include #include #include using namespace std; class Date { private: int day; int month; int year; public: Date() { day = 0; month = 0; year = 0; } Date(int alpha, int beta, int charlie) { day = alpha; month = beta; year = charlie; } void setDay(int day) { this->day = day; } void setMonth(int month) { this->month = month; } void setYear(int year) { this->year = year; } int getDay() { return day; } int getMonth() { return month; } int getYear() { return year; } void Display() { cout << day << "/" << month << "/" << year << endl; } }; class Time { private: int sec; int min; int hour; public: Time() { sec = 0; min = 0; hour = 0; } Time(int alpha, int beta, int charlie) { sec = alpha; min = beta; hour = charlie; } void setSec(int sec) { this->sec = sec; } void setMin(int min) { this->min = min; } void setHour(int hour) { this->hour = hour; } int getSec() { return sec; } int getMin() { return min; } int getHour() { return hour; } void Display() { cout << hour << ":" << min << ":" << sec << endl; } }; class Flight { private: Date dept; Date arrl; Time depart; Time arrival; int flightID; string fltStatus; int totalSeats; int reservedSeats; public: Flight() { flightID = 0; totalSeats = 0; reservedSeats = 0; fltStatus = ""; } Flight(int a, int b, int c, string d) { flightID = a; totalSeats = b; reservedSeats = c; fltStatus = d; } void setFlightID(int ID) { flightID = ID; } void setTotalseats(int seats) { totalSeats = seats; } void setReservSeats(int res) { reservedSeats = res; } void setStatus(string state) { fltStatus = state; } int getflightID() { return flightID; } int getTotalseats() { return totalSeats; } int getreserveSeats() { return reservedSeats; } string getStatus() { return fltStatus; } void Display() { cout << "Flight ID: " << flightID << endl; cout << "Flight Total Seats: " << totalSeats << endl; cout << "Reserved seats: " << reservedSeats << endl; cout << "Flight Status: " <
Add folowing given description to the below given C++ program
Description:
- Add a member function delayFlight(int) in the Flight class to delay the flight by the
number of minutes pass as input to this function. (For simplicity, assume that delaying a flight
will not change the Date). - Add a member function reserveSeat(int) which reserves the number of seats passed as
input to this function. Display appropriate message to the user if the seats are not available. - Write a main program to test the functionality of your Flight class.
Program Code:
#include <iostream>
#include <conio.h>
#include <string>
using namespace std;
class Date
{
private:
int day;
int month;
int year;
public:
Date()
{
day = 0;
month = 0;
year = 0;
}
Date(int alpha, int beta, int charlie)
{
day = alpha;
month = beta;
year = charlie;
}
void setDay(int day)
{
this->day = day;
}
void setMonth(int month)
{
this->month = month;
}
void setYear(int year)
{
this->year = year;
}
int getDay()
{
return day;
}
int getMonth()
{
return month;
}
int getYear()
{
return year;
}
void Display()
{
cout << day << "/" << month << "/" << year << endl;
}
};
class Time
{
private:
int sec;
int min;
int hour;
public:
Time()
{
sec = 0;
min = 0;
hour = 0;
}
Time(int alpha, int beta, int charlie)
{
sec = alpha;
min = beta;
hour = charlie;
}
void setSec(int sec)
{
this->sec = sec;
}
void setMin(int min)
{
this->min = min;
}
void setHour(int hour)
{
this->hour = hour;
}
int getSec()
{
return sec;
}
int getMin()
{
return min;
}
int getHour()
{
return hour;
}
void Display()
{
cout << hour << ":" << min << ":" << sec << endl;
}
};
class Flight
{
private:
Date dept;
Date arrl;
Time depart;
Time arrival;
int flightID;
string fltStatus;
int totalSeats;
int reservedSeats;
public:
Flight()
{
flightID = 0;
totalSeats = 0;
reservedSeats = 0;
fltStatus = "";
}
Flight(int a, int b, int c, string d)
{
flightID = a;
totalSeats = b;
reservedSeats = c;
fltStatus = d;
}
void setFlightID(int ID)
{
flightID = ID;
}
void setTotalseats(int seats)
{
totalSeats = seats;
}
void setReservSeats(int res)
{
reservedSeats = res;
}
void setStatus(string state)
{
fltStatus = state;
}
int getflightID()
{
return flightID;
}
int getTotalseats()
{
return totalSeats;
}
int getreserveSeats()
{
return reservedSeats;
}
string getStatus()
{
return fltStatus;
}
void Display()
{
cout << "Flight ID: " << flightID << endl;
cout << "Flight Total Seats: " << totalSeats << endl;
cout << "Reserved seats: " << reservedSeats << endl;
cout << "Flight Status: " <<fltStatus << endl;
cout << "Date of Deperture: ";
dept.Display();
cout << "Time of Departure: ";
depart.Display();
cout << "Date of Arrival: ";
arrl.Display();
cout << "Time of Arrival: ";
arrival.Display();
}
};
int main()
{
_getch();
return 0;
}
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)