Problem

Airline Reservations Write a reservation system for an airline flight. Assume the ai...

Airline Reservations Write a reservation system for an airline flight. Assume the airplane has 10 rows with 4 seats in each row. See Fig. 7.77. Use a two-dimensional array of strings to maintain a seating chart. In addition, create an array to be used as a waiting list in case the plane is full. The waiting list should be “first come, first served”; that is, people who are added early to the list get priority over those added later. Allow the user the following three options:

(a) Add a passenger to the flight or waiting list.

1. Request the passenger’s name.

2. Display a chart of the seats in the airplane in tabular form.

3. If seats are available, let the passenger choose a seat. Add the passenger to the seating chart.

4. If no seats are available, place the passenger on the waiting list.

(b) Remove a passenger from the flight.

1. Request the passenger’s name.

2. Search the seating chart for the passenger’s name and delete it.

3. If the waiting list is empty, update the array so the seat is available.

4. If the waiting list is not empty, remove the first person from the list, and give him or her the newly vacated seat.

(c) Quit.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 7