Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An Airline Reservation System A small airline has just purchased a computer for its new automated reservation system. You have been asked to write to

image text in transcribed
An Airline Reservation System A small airline has just purchased a computer for its new automated reservation system. You have been asked to write to program the new system.You are to write a program to assign seats on each flight of the airline's only plane, which has a capacity of 10 seats. You are program should display the following menu of options: Please type 1 for First Class and Please type 2 for Economy Class. If the user types 1, your program should assign a seat in the first class section (seats 1 to 4) If the user types 2, your program should assign a seat in the economy section (seats 5 to 10), Your program should print a boarding pass indicating the person's seat number and whether it is in the first class or economy class section of the plane. Use an array (or vector) to represent the seating chart of the plane, Initialize all elements of the array (or vector) to 0 to indicate that all seats are empty. As seats are assigned, assign to the corresponding elements of the array (or vector) to indicate that the seats are no longer available. Your program should never assign a seat that has already been assigned. When the first class section is full your program should ask the user if it is acceptable to be placed in the economy section and vice-versa. if yes, then make the appropriate seat assignment. If no, then print the message that "The 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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions