Write a program to assign passengers seats in an airplane. Assume a small airplane with seat numbering as follows:
A 1 2 3 4 5
B 1 2 3 4 5
C 1 2 3 4 5
D 1 2 3 4 5
E 1 2 3 4 5
The program should display the seat pattern with an 'X' marking the seats already assigned. For example, after seats 1A, 2B and 4C are taken, the display should look like this:
A X 2 3 4 5
B 1 X 3 4 5
C 1 2 3 X 5
D 1 2 3 4 5
E 1 2 3 4 5
After displaying the seats available, the program prompts for the seat desired, the user types in a seat, and then the display of available seats is updated. This continues until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should say that the seat is occupied and ask for another choice.
This program can be done using either a single-dimensional array or a multi-dimensional array. Since, we only discussed
single-dimensional arrays in class, do this program using a single-dimensional array.
As with all your programs, be sure to include the standard header talked about in class in your program. Also, be sure to comment your program appropriately. Try to use functions/ procedures where applicable. Be sure to include headers on these functions/procedures when used.