Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c++. A small airline has just purchased a computer for its net automated reservations system. You have been asked to program the new system.

In c++. A small airline has just purchased a computer for its net automated reservations system. You have been asked to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats).

Your program should display the following menu of alternatives -- Please type 1 for "Economy", Please type 2 for "Business", and Please type 3 for a passenger manifest, and type 4 to exit. If the person types 1, your program should assign a seat in the economy section (seats 1-5). If the person types 2, your program should assign a seat in the business section (seats 6-10). For either press of 1 or 2, your program needs to collect the name of the passenger. If the user types 3, your program should display a passenger manifest which lists the passenger names and their seating position on the plane.

Use a single-subscripted boolean array to represent the seating chart of the plane. Also use an array of strings to represent the names of the passengers. Initialize all of the elements of the array representing the seating chart of the plane to false. As each seat is assigned, set the corresponding elements of the array to true, and collect the name of the passenger being assigned to the seat. You are going to subdivide your program into functions.

Your program should, of course, never assign a seat that has already been assigned. When the economy section is full, your program should ask the person if it is acceptable to be placed in the business section (and vice versa). If yes, then make the appropriate seat assignment. If no, then print the message "Next flight leaves in 3 hours".

Must include:

The program contains a working function to display the menu for the airline booking system. The function should display the menu of alternatives and then collect the response from the user and return the value from the function back to the main program.

The program contains a working function to book the economy section of the plane. If the function is able to successfully book the person into the economy section, then the function returns the boolean value of true. Otherwise, the function returns the boolean value of false.

The program contains a working function to book the business section of the plane. If the function is able to successfully book the person into the business section, then the function returns the boolean value of true. Otherwise, the function returns the boolean value of false.

The program contains a working function which displays to the screen the passenger manifest.

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

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions

Question

What are you curious about regarding Will?

Answered: 1 week ago