Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem # 2: (Airline Reservations System) [35 marks] A small airline has just purchased a computer for its new automated reservations system. You have

image text in transcribed

Problem # 2: (Airline Reservations System) [35 marks] A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You're to write an application to assign seats on each flight of the airline's only plane (the capacity of the plane is 10 seats of the same class). The flight ticket costs 500 $. Use a one-dimensional array of type Boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. The user can choose his seat number (from 1 to 10) if it is available. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your application should never assign a seat that has already been assigned. The baggage allowance is a single bag of 10 kg. Each extra kg is charged with 5 $. However, the weight of the bag should never exceed 20 kg. The reservation request of the customer should be rejected if his chosen seat number is not available and/or his baggage exceeds 20 kg and justified rejection message(s) should be alerted to the customer. Otherwise, a confirmation message that contains the customer's seat number, extra weight fees, and total fees is alerted. The reservation process should continuously run for other customers until the user of the application explicitly ends it. At the end of the application, a summary of the number of reserved seats with total income should be alerted to the user.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Solutions Step 1 Heres a solution in Python that implements the Airline Reservations System as described in the question SEATS False 10 Initialize all ... 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

Java How To Program Late Objects Version

Authors: Paul Deitel, Deitel & Associates

8th Edition

0136123716, 9780136123712

More Books

Students also viewed these Programming questions

Question

We are interviewing quite a few people, why should we hire you?

Answered: 1 week ago