(Airline Reservations System) A small airline has just purchaseda computer for i
ID: 3614096 • Letter: #
Question
(Airline Reservations System) A small airline has just purchaseda computer for its
new automated reservations system. You have been asked todevelop the new system.
You are to write an application to assign seats on eachflight of the airline's only plane
(capacity: 10 seats).
Your application should display the following alternatives:Please type 1 for
First Class and Please type 2 for Economy. If the user types 1,your
application should assign a seat in the first-class section(seats 15).
If the user types 2, your application should assign a seat inthe economy section (seats 610).
Your application should then display a boarding passindicating the person's seat number
and whether it is in the first-class or economy section of theplane.
Use a one-dimensional array of primitive type boolean torepresent the seating chart
of the plane. Initialize all the elements of the array to falseto indicate that all the
seats are empty. As each seat is assigned, set the correspondingelements of the array
to true to indicate that the seat is no longer available.
Your application should never assign a seat that hasalready been assigned. When the
economy section is full, your application should ask the personif it is acceptable to be
placed in the first-class section (and vice versa). If yes, makethe appropriate seat
assignment.
If no, display the message "Next flight leaves in 3hours."
Explanation / Answer
x.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.