Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C PROGRAMMING ONLY) (Airline Reservation System) A small airline has just purchased a computer for its new automated reservations system. The president has asked you

(C PROGRAMMING ONLY)

(Airline Reservation System) A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. Youll write a program to assign seats on each flight of the airlines only plane (capacity: 10 seats). Your program should first be setup for the flight. You need to ask the user the specifications i.e. the number of first class and economy seats. As an example the user inputs 5 4 Meaning 5 first class and 4 economy class seats. Your program should display the following menu of alternatives and the available seats: Please type 1 for "first class (5) Please type 2 for "economy (4) Please type 3 to display seating chart. Please type 4 to end If the person types 1, then your program should assign a seat in the first-class section (seats 15). If the person types 2, then your program should assign a seat in the economy section (seats 69). Your program should then print a boarding pass indicating the person's seat number. Example Boarding Pass: 1 // user selects 1 in the menu Seat Number: 2 // the program checks its seat availability array and outputs the seat number allocated if it is available Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer available. Your program should, of course, never assign a seat that has already been assigned. When the X section is full, your program should print X Section is Full and show the menu again(X can either be economy or first class). When one seat is assigned, the program prints the menu with updated available seats. When option 3 is selected, two arrays will be printed in the following format. [1,0,0,0,0][1,0,0,0,0] the first and second brackets show the availability of first class and the economy in order. Zeros indicate availability and one means reserved.

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

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

Distinguish between forecasting HR requirements and availability.

Answered: 1 week ago

Question

2. What, according to Sergey, was strange at this meeting?

Answered: 1 week ago