Question: Design and code a program to allow passengers to book flights. In order for a passenger to book a flight, he/she must enter the following:
Design and code a program to allow passengers to book flights. In order for a passenger to book a flight, he/she must enter the following:
First name
Last name
From (city of departure)
To (destination city)
Departure date (use Java date class)
Return date (use Java date class)
Choose a seat. Assume a small airplane with seat numberings as follows:
1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D
You will need to define three classes as part of your model:
The Reservation class will have instance variables to store the reservations details including: seat, from, to, departure date, and return date.
The Passenger class will have instance variables to store the passengers first name, last name, and reservation.
The BookingGUI class will contain all the gui components and listeners. In addition, it should have an array of Passengers, a method to add passenger to the passengers array, and a method to list all passengers. The next screen shot shows the way your GUI should look like:

Fly AnyWhere First Name Last Name From To Departure MM/DD/YYYY Return MM/DD/YYYY Seat 1A Book List Reservations Clear Console Console Fly AnyWhere First Name Last Name From To Departure MM/DD/YYYY Return MM/DD/YYYY Seat 1A Book List Reservations Clear Console Console
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
