This program needs to be programmed in c++. I asked before and they have not followed the requirements. I am struggling with it, so I could use the answer to get an idea and write my own code. Please...


This program needs to be programmed in c++. I asked before and they have not followed the requirements. I am struggling with it, so I could use the answer to get an idea and write my own code. Please help.


Write a C++ program that will assign seats for a commercial airplane. The airplane has 9 rows<br>with 4 seats in each row. Rows 1 and 2 are first class; the remaining rows are economy class.<br>Output the seating plan in the following format:<br>A<br>C<br>D<br>Row 1<br>Row 2<br>*<br>Row 3<br>X<br>Row 4<br>X<br>*<br>Row 5<br>Row 6<br>*<br>Row 7<br>X<br>Row 8<br>*<br>Row 9<br>X<br>X<br>X<br>Here, * indicates the seat is available and X indicates the seat is occupied.<br>МЕТНOD<br>The top level of this program should look like:<br>initialize all seats to empty (**')<br>do<br>display seating plan<br>ask user to enter data<br>assign seat<br>continue?<br>while more requests<br>display seating plan<br>INPUT<br>The data consists of a series of requests for seats on the plane. Each request consists of four<br>parts:<br>(string – contains both first & last name)<br>(enum type – FIRST or COACH)<br>(character)<br>(character)<br>customer name<br>class<br>seat row<br>seat column<br>Assumptions:<br>> Check for out-of-range errors (rows 1-9 and columns A-D) when reading in data – force<br>the user to correct seat entry.<br>→ If the requested seat is occupied and there is an available seat in that class, force the user<br>to re-enter seat.<br>→ If there is a request for first class and first class is full but there are available seats in<br>economy class, place the customer in the first available seat in economy class.<br>> If there is a request for economy class and economy class is full but there are available<br>seats in first class, place the customer in the last available seat in first class.<br>U X * * X *<br>M * * X * X *<br>

Extracted text: Write a C++ program that will assign seats for a commercial airplane. The airplane has 9 rows with 4 seats in each row. Rows 1 and 2 are first class; the remaining rows are economy class. Output the seating plan in the following format: A C D Row 1 Row 2 * Row 3 X Row 4 X * Row 5 Row 6 * Row 7 X Row 8 * Row 9 X X X Here, * indicates the seat is available and X indicates the seat is occupied. МЕТНOD The top level of this program should look like: initialize all seats to empty (**') do display seating plan ask user to enter data assign seat continue? while more requests display seating plan INPUT The data consists of a series of requests for seats on the plane. Each request consists of four parts: (string – contains both first & last name) (enum type – FIRST or COACH) (character) (character) customer name class seat row seat column Assumptions: > Check for out-of-range errors (rows 1-9 and columns A-D) when reading in data – force the user to correct seat entry. → If the requested seat is occupied and there is an available seat in that class, force the user to re-enter seat. → If there is a request for first class and first class is full but there are available seats in economy class, place the customer in the first available seat in economy class. > If there is a request for economy class and economy class is full but there are available seats in first class, place the customer in the last available seat in first class. U X * * X * M * * X * X *
OUTPUT<br>For each request, print out all input information along with appropriate messages including<br>which seat was assigned to the customer or any

Extracted text: OUTPUT For each request, print out all input information along with appropriate messages including which seat was assigned to the customer or any "weird" action that was taken to find a seat. Make sure output is clear, easy to read, and labelled appropriately. Output should go to a file. DATA STRUCTURES You will need a two-dimensional array to store the seat plan – each entry should be a single character (**' or 'X'). Make the class variable an enumerated user-defined data type with FIRST and COACH as its possible values. Use a linear search to find the next available seat when a requested section is full. Do not access variables globally – enumerated data types and constants should be global. Use static allocation of the array – do not use pointers, standard libraries, or classes. Most of the work should be performed in functions. Eliminate redundant code. Input data does not need to be retained after the seat has been assigned.
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here