Question: PLEASE MAKE IT SIMPLE AND USE C for the coding please This assignment asks the user to write a program to assign seats in an

PLEASE MAKE IT SIMPLE AND USE C for the coding please

This assignment asks the user to write a program to assign seats in an airplane. There will be 12 seats on the plane, 4 in first class and 8 in economy. Initialy all seats are empty.

The program should display the following menu for the user in a loop until the user types 0 to quit:

Please type 1 for "first class" Please type 2 for "economy" Please type 0 to quit

If the user types 1 then the user should be assigned a seat in first class. If the user types 2 then the user should be assigned a seat in economy.

The program should not assign a seat that has already been assigned. If all seats in the desired section are taken, but there are available seats in the other section, then the user should be asked if they want a seat in the other section.

If the user says no, tell them "The next flight will be tomorrow."

Otherwise give them a seat in the other section.

The program should print a line indicating the seat the person was assigned. It would be a number from 1 to 12. This would be like a boarding pass.

You must use an array to represent the seats on the plane. This would be a one-dimentional array of size 12.

If the user types 0 as a choice the program should exit with a 0 return code since it is ended as requested.

Create a simple Makefile to compile your program into an executable called planeseats.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!