Question: Two-Dimensional Array Problem Write a C++ program to assign passenger seats in an airplane. Chesapeake Airlines is a small commuter airline with seats for 20
Two-Dimensional Array Problem
Write a C++ program to assign passenger seats in an airplane. Chesapeake Airlines is a small commuter airline with seats for 20 passengers in 5 rows of 4 seats each. Here is the layout:
1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
The user enters the row (1 5) and the seat (A D). The program checks the array to see if the seat is available. An X in the array indicates the seat is not available. If the seat is available, assign an X to that position in the array. If its unavailable, display a message to the passenger. After some seats are assigned, the layout may look like this: 1 X B C X
2 A B C D
3 A X C X
4 A B C D
5 A B C D
Continue processing requests until the user enters -1 for seat.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
