Question: Project 2 Airline Seat Reservations Write a program to assign passenger's seats in a small airplane. Assume the plane has its seats numbered as follows:
Project Airline Seat Reservations
Write a program to assign passenger's seats in a small airplane. Assume the plane has its seats numbered as follows:
Row
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
A B C D
To reserve a seat, the user should enter the row and seat A D Here are the error conditions when checking for a specified seat entered by the user:
the row is not between and
the seat is not A B C or D
the seat at that rowcolumn combination is already reserved
In any of the three cases, print an error message and prompt for the next seat to reserve.
Model the seats in the plane using a twodimensional array with rows representing the seat rows and the columns representing the seats in that row.
Use a loop in your program which continues to prompt for a seat to reserve until either the user specifies a sentinel to stop the program, or when all seats are reserved.
After a seat is reserved, the program should display the seat reservation pattern, with an X marking the seats already assigned. If a seat isn't reserved, then print its seat letter A B C or DSee the example below.For example, after seats ABD and C are reserved, your display might show the following:
Row
X B C D
A X C D
A B C D
A B C X
A B C D
A B X D
A B C D
There are seats available.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
