Question: Please write a non-functional program. C++ A small airline needs a program that assigns seats on each flight of the airline's single aircraft (20 seat

Please write a non-functional program. C++

A small airline needs a program that assigns seats on each flight of the airline's single aircraft (20 seat capacity).

The program should display the following menu of alternatives:

Please enter 1 for "smokers". Please enter 2 for "non-smokers".

If the person enters 1, a seat should be assigned in the "smoking" section (seats 1 to 10); if the person enters 2, a seat should be assigned in the "non-smoking" section (seats 11 to 20). A boarding pass should then be printed, indicating the person's seat number and whether they are in the smoking or non-smoking section of the aircraft.

Use a one-dimensional array to represent the aircraft seating chart, previously initialize all array elements to zero to indicate that all seats are empty. As each seat is assigned, set the corresponding array elements to 1 to indicate that the seat is no longer available.

The program should never assign a seat that has already been assigned. When the "smoking" section is full, the person should be asked if it is acceptable to be placed in the "non-smoking" section or vice versa. If they say yes, then make the appropriate seat assignment; if they say no, then print the message "Next flight leaves in 3 hours".

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!