Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment: Implement a Flight Booking System Objective: You will develop parts of a simple Flight Booking System based on the Java skeleton created in the

Assignment: Implement a Flight Booking System
Objective:
You will develop parts of a simple Flight Booking System based on the Java skeleton created in the
previous assignment. This system will involve persisting data using object serialization, and
implementing search functionality that works against persisted data. It also involves creating and
using a custom exception type.
Tasks:
1. Add flights:
Implement a method to add new flights. Make it possible to enter the arrival and
departure times using a time zone.
2. Search Functionality:
Implement a search method to find flights based on departure and destination. It
should be possible to search for only departures, only destinations and a combination
of departure and destination. Seats and prices don't need to be displayed at this
moment (but feel free to think about how to best present this information).
3. Data Persistence:
Implement object serialization to save and load the state of all Flights. Load all flights
when starting the application and save them all before quitting.
4. Exception Handling:
Handle exceptions that may occur during file operations.
Implement a custom exception called FlightBookingException and throw it whenever a
new flight is added using an already existing flight number. This exception should not
crash the application.
5. User Interface:
Create a simple text-based interface that allows users to interact with the system.
Include options to add flights, passengers, bookings, and to search for flights. (Note that
you only have to implement the functionality for add flights and search for flights).
Create a Main class and use it for all user interaction (input and output). That is, there
should be no print statements but in the Main class.
Expected Output:
1. Add Flight
2. Add Passenger
3. Book a Flight
4. Search Flights
5. View Bookings
6. Save and Exit
Choose an option: 1
Enter Flight Number: SO123
Enter Departure City: Stockholm
Enter Destination City: Malm
Enter Departure Time (yyyy-MM-dd HH:mm +/-HH:mm): 2023-12-1208:00+02:00
Enter Arrival Time (yyyy-MM-dd HH:mm +/-HH:mm): 2023-12-1210:00+02:00
Flight

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Students also viewed these Databases questions

Question

Identify the different stages of sleep.

Answered: 1 week ago

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago