Question: Program in C please: Asmall airline has just purchased a computer for its new automated reservations system. The CTO has asked you to program the

Program in C please: Asmall airline has just purchased a computer for its new automated reservations system. The CTO has asked you to program the new system. You will write a program to assign seats on each flight of the airlines only plane (capacity: 140 seats, in 20 rows). Use a 2D array for seat assignments. For the sake of simplicity, assume that each row has 7 seats labeled A, B, D, E, F, H, I. Rows A and I are window seats. (Hint: To help you visualize the seat arrangements, you can either think of seats labelled in first row as A1, B2, D4, ... I9 and second row labelled as A10, B11, D13 and so on. Another way is to think of seats in row 1 labelled as A1, B1, D1, ..., I1 and then second row as A2, B2, D2, and so on. Use whatever helps). Due to COVID restrictions, there must be one seat left empty (or blocked) in between two passengers (ignore the isles).
At the start of the program, your program should give the following menu options to the user: (1) Choose a seat!
(2) prints a boarding pass for a chosen seat number indicating the person's name, seat
number and whether its in the first class or business class or economy section of the plane (For example: JOHN DOE, SEAT: B2, Level: First Class).
User will provide the seat number for this option and if no passenger is assigned to the selected seat, you should print a message, Seat Unassigned - No Boarding pass available. Try Again!. If the seat was blocked due to Covid, print the appropriate message too.
(3) Display the seating map/chart showing all 140 seats and indicating if each seat is filled and which seats are blocked.
(4) prints a passenger manifest showing names of all passengers and their seat numbers in a tabular format. The default view prints the manifest organized by seat numbers. User may choose the option to print the manifest in alphabetical format.
(5) Quit the program
Your program must show the above menu if user does not select the valid input option. Your program must not quit until Quit option is selected.
If user likes to choose a seat, the program should display the following menu of alternatives:
Please type F for "first class" Please type B for "business class" Others will be economy class.
If the person types F, then your program should assign a seat in the first class section (rows 1- 3). If the person types B, then your program should assign a seat in the business class section (rows 4-7). For others, your program should assign a seat in the economy section (rows 820). The first row of economy section (row 8) has extra leg room and is consider Priority economy row. Seat Assignment is done using random numbers generator (i.e., Use a random number generator to select the seat -row number and column, and then check if that seat is un-assigned). Lets call this INITIAL SEAT SELECTION. Confirm with the user if he/she wants a Window seat or Aisle seat. If user doesnt want the selected seat, repeat the random seat assignment process again (repeat it not more than 3 times and if user cannot make up his/her mind, let them travel on next flight)!
Your program should, of course, never assign a seat that has already been assigned or has been blocked due to Covid. When the first class section is full, your program should ask the person if its acceptable to be placed in the business class. Similarly, if the business section is full, ask the user if economy section is acceptable. For economy class, user should have the choice of selecting seat in priority economy row if available. If user doesnt like the seat, he/she can always choose the next flight!
After the INITIAL SEAT SELECTION, User should have the choice of upgrading to the higher class (i.e., business class or first class) if a seat is available. User may also downgrade from higher class (i.e., first class or business class) if they wish. To keep things simple, you should inquire about upgrade/downgrade options after the INITIAL SEAT SELECTION is done. If user chooses to change his/her choice, then make the appropriate seat assignment and show the FINAL SEAT ASSIGNMENT. If no seat is available in the chosen section, then confirm with the user if they still want to use the INITIAL SEAT SELECTION or print the message "Next flight leaves in 3 hours."
Note: Airlines typically use a seating map/chart similar to the one shown below. Design your own version of seating chart (you dont have to use graphics or colors)
Use a double-subscripted (2D) array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer available.
Note: You may need to maintain a separate array to store passenger names. This can be done in several ways including using 1-dimensional or 2-dimensionsla arrays. You will also have to think carefully about how to print the manifest in alphabetical order.
Note: Write a modular program, a program which uses appropriate functions to complete the task. Dont write all the code in main function.
To-do:
Part1: Start by writing a complete pseudocode or algorithm (describing the steps that
you will need to perform for the program described above). This must include sufficient details that would allow you to write the c code directly. For submission, a txt file or *.c file with comments will suffice.
Part2: Implement and fully test the program as described above. While testing, make sure that you have enough passengers added to the flight to check if the users can successfully upgrade and downgrade, as needed. Test all test cases properly

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!