Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

You work for an airline, a small airline, so small you have only one plane. Your plane has 5 rows with 4 seats in each

You work for an airline, a small airline, so small you have only one plane. Your plane has 5 rows with 4 seats in each row, 2 seats are on each side of the plane with an aisle down the middle.

I have developed the class Seat.javaimage text in transcribed, which represents a seat on the plane. Please review Seat.javaimage text in transcribed and understand it before you start this assignment. You are to use Seat.javaimage text in transcribed in this assignment. You are not to change Seat.javaimage text in transcribed.

In this assignment you must present the following menu to the user and then implement the selections. You may sell seats until all seats are sold (i.e. dont sell a seat more than once).

Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit.

An example of the user input/output is below:

Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 1

OO OO OO OO OO OO OO OO OO OO

Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 2 Enter the row: 1 Enter the seat: 1 Row: 0 Seat: 0 Aisle: false Window: true Occupied: false Cost: $452 Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 3

Row: 4 Seat: 2 Aisle: true Window: false Occupied: false Cost: $210 Row: 2 Seat: 2 Aisle: true Window: false Occupied: false Cost: $222 Row: 1 Seat: 2 Aisle: true Window: false Occupied: false Cost: $224 Row: 0 Seat: 2 Aisle: true Window: false Occupied: false Cost: $227 Row: 2 Seat: 3 Aisle: false Window: true Occupied: false Cost: $228 Row: 0 Seat: 1 Aisle: true Window: false Occupied: false Cost: $232 Row: 1 Seat: 0 Aisle: false Window: true Occupied: false Cost: $245 Row: 2 Seat: 1 Aisle: true Window: false Occupied: false Cost: $249 Row: 3 Seat: 0 Aisle: false Window: true Occupied: false Cost: $249 Row: 4 Seat: 3 Aisle: false Window: true Occupied: false Cost: $254 Row: 1 Seat: 3 Aisle: false Window: true Occupied: false Cost: $281 Row: 4 Seat: 0 Aisle: false Window: true Occupied: false Cost: $327 Row: 3 Seat: 1 Aisle: true Window: false Occupied: false Cost: $344 Row: 3 Seat: 2 Aisle: true Window: false Occupied: false Cost: $354 Row: 2 Seat: 0 Aisle: false Window: true Occupied: false Cost: $385 Row: 0 Seat: 3 Aisle: false Window: true Occupied: false Cost: $410 Row: 1 Seat: 1 Aisle: true Window: false Occupied: false Cost: $413 Row: 4 Seat: 1 Aisle: true Window: false Occupied: false Cost: $431 Row: 3 Seat: 3 Aisle: false Window: true Occupied: false Cost: $437 Row: 0 Seat: 0 Aisle: false Window: true Occupied: false Cost: $452 Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 4

Enter the row of the seat you would like to purchase: 1 Enter the seat you would like to purchase in row 0: 1 Row: 0 Seat: 0 Aisle: false Window: true Occupied: true Cost: $452 Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 1

XO OO OO OO OO OO OO OO OO OO

Please select from the following menu: Enter 1 to see a map of the seats: O available, X unavailable. Enter 2 to get the information on a specific seat. Enter 3 to print available seats sorted by price, low to high. Enter 4 to purchase a seat. Enter 5 to see this menu again. Enter 0 to quit: 0

Transcribed image text

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions