Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class. Your program must prompt the user to enter the following information:

  • Ticket type (first class, business class, or economy class)
  • Desired seat

The application needs to be menu driven asking the user for the information and informing the user of the resulting operation by redisplaying the current state of the bookings.

If an already booked seat is selected the user needs to be notified and option given to select another seat to reserve.

Important Design

Solution needs to be well structured with functions and no global variables. Global constants are fine for using the information about array sizes. All functions must provide single well-defined purpose.

Sample run of the application showing the flow of the user interaction with the application that you need to implement.

This program assigns seats for a commercial airplane.
The current seat assignments is as follows.
A B C D E F
Row 1 * * * * * *
Row 2 * * * * * *
Row 3 * * * * * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat
Rows 1 and 2 are for first class passengers.

Rows 3 through 7 are for business class passengers.
Rows 8 through 13 are for economy class passengers.
To reserve a seat enter Y/y(Yes), N/n(No): y
Enter ticket type: F/f (first class); (B/b) (business class); E/e
(economy class): f

Enter Row number 1 - 2: 1

Enter seat number (A - F): b

Enter seat number (A - F): B

This seat is reserved for you
A B C D E F
Row 1 * X * * * *
Row 2 * * * * * *
Row 3 * * * * * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat

This program assigns seats for a commercial airplane.
The current seat assignments is as follows.
A B C D E F
Row 1 * X * * * *
Row 2 * * * * * *
Row 3 * * * * * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat

Rows 1 and 2 are for first class passengers.
Rows 3 through 7 are for business class passengers.
Rows 8 through 13 are for economy class passengers.
Reserve another seat Y/y(Yes), N/n(No): y

Enter ticket type: F/f (first class); (B/b) (business class); E/e
(economy class): b

Enter Row number 3 - 7: 3

Enter seat number (A - F): D

This seat is reserved for you
A B C D E F
Row 1 * X * * * *
Row 2 * * * * * *
Row 3 * * * X * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat

This program assigns seats for a commercial airplane.
The current seat assignments is as follows.
A B C D E F
Row 1 * X * * * *
Row 2 * * * * * *
Row 3 * * * X * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat

Rows 1 and 2 are for first class passengers.
Rows 3 through 7 are for business class passengers.
Rows 8 through 13 are for economy class passengers.
Reserve another seat Y/y(Yes), N/n(No): y

Enter ticket type: F/f (first class); (B/b) (business class); E/e
(economy class): f

Enter Row number 1 - 2: 1

Enter seat number (A - F): B

*#*#*#*# This seat is occupied *#*#*#*#
Make another selection
A B C D E F
Row 1 * X * * * *
Row 2 * * * * * *
Row 3 * * * X * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat

Enter Row number 1 - 2: 2

Enter seat number (A - F): B

This seat is reserved for you
A B C D E F
Row 1 * X * * * *
Row 2 * X * * * *
Row 3 * * * X * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * * *
Row 8 * * * * * *
Row 9 * * * * * *
Row 10 * * * * * *
Row 11 * * * * * *
Row 12 * * * * * *
Row 13 * * * * * *
* -- available seat
X -- occupied seat
. . .

Task to perform for submission

Go through the process of reserving the following the following seats

First Class
1A 1B 2B 2C

Business Class
3D 3E 3F
5A 6A 7A

Economy Class
13A 13B 13C 13D 13E 13F
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.