Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

FlightReservationSystem class: The FlightReservationSystem class is one to run a simple airline reservation system. It should have two containers:

FlightReservationSystem class:

The FlightReservationSystem class is one to run a simple airline reservation system. It should have two containers: one for all the people (passengers) known to the system, and the other for all the flights known to the system. Both containers should be keyed dictionaries, with the key for a person being their name, and the key for a flight being its number. The system should display a message to the user for the user to select an operation. When an operation is selected, it should be carried out, and then another operation selected. It is easiest to handle operation selection by numbering the operations and having the user enter an integer. Note that when a value is read using Scanner, other than by nextLine(), none the characters after the value are read. Thus, a subsequent nextLine() read (say to read a name)will read those

2

characters up to and including the next end-of-line characters, rather than the characters on the next line (which is probably what was wanted). Such a read often just obtains the characters to mark the end of the line. Thus, after reading an int value, you might want to invoke a nextLine call to read the rest of the line.

The operations to be supported are the following: 1. quit

2. add a new passenger to the system 3. add a new flight to the system 4. display the empty seats of a specified flight 5. book a passenger on a flight 6. book a first-class passenger on a flight 7. assign a seat to a passenger on a flight where the passenger already has a booking 8. display all the passengers in the system 9. display all the flights in the system

When the user quits, the system should print out the people and flights that are currently in the system. The output of the passengers and flights can simply use the default format obtained by invoking toString on their container. The parameters for these operations should be read from the console. In most cases, the parameters for the operation should be obvious. For example, to book a passenger on a flight, the persons name and the number of the flight need to be entered. This operation assumes that both the passenger and the flight are already in the system. The assign a seat operation needs the persons name, the flight number, and the seat. Although they are easy to do, to save a little time, operation 3 (display empty seats) and operation 5 (book first-class passenger) are optional, and you need not do them. The last two commands are included to help you check your system by outputting the passengers and flights to ensure that the correct information is stored.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question