Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

PROGRAM IN 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago