You are to write a program to assign seats on each flight for an airline's only flight with a capacity of 80 seats (20 rows, and 4 columns).
Your program should display the following menu:
Enter 1 for first class, 2 for business class, 3 for economy class, 4 to display the available seats, and 5 to quit:
If a person enters 1, your program should assign a seat in the first class (rows 1 - 3). If a person enters 2, your program should assign a seat in business class (rows 4 - 7). If a person enters 3, your program should assign a seat in economy class (rows 8 - 20). If the seat is available at the given class, then the program should issue a boarding pass with the row and column number, and class type. If a customer asks for a class that is already full, then your program should ask the customer if it is okay to assign a seat in one of the other classes. If the flight is full, the program should print the message "This Flight is Full, Next Flight leaves in Three Hours".
Use a two dimensional array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer available.
Your program should of course never assign a seat that has already been assigned.
You are required to write this program using functions. The prototype of your functions may look like as below or you may define them in any other way that you wish :
void MakeFirstClassReservation(int a[][4] );
void MakeBusinessClassReservation(int a[][4] );
void MakeEconomyClassReservation(int a[][4] );
bool IsFirstClassFull(int a[][4] );
bool IsBusinessClassFull(int a[][4] );
bool IsEconomyClassFull(int a[][4] );
void DisplayArray( int a[][4]);
etc.
If you define proper functions and use them in your main program, then your main program should not be complicated, and it will consist of small number of manageable statements.