Question: Write a program that can be used to assign seats for a commercial airline. The airplane has 13 rows, with 6 seats in each row.
Write a program that can be used to assign seats for a commercial airline. The airplane has 13 rows, with 6 seats in each row. Rows 1-3 are first-class seats, while rows 5-13 are economy seats.
Create a menu-driven program. Display a map of all of the seats on the airplane (display a star (*) to indicate the seat is available; display an X if the seat is occupied). Ask the user which class of ticket they are interested in (first-class or economy) and to select the specific seat(s) they wish to reserve.
You must create this program by writing the following functions: displayMap will display the current seating map of the entire airplane, makeReservation will let the user select the specific seat(s) they wish to reserve, and validateFunction will make sure that a) the user is not trying to reserve seats that are already taken and b) the users seat-class choice is appropriate for the specific seats theyve selected.
A B C D E F
ROW 1 * * X * X X
ROW 2 * X * X * X
ROW 3 X * X X * X
(ETC)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
