Question
In JAVA create a class called Flight which is representative of a flight between an origin and destination 1. Create methods that will update the
In JAVA create a class called Flight which is representative of a flight between an origin and destination
1. Create methods that will update the following:
Origin Airport
Origin Code
Destination Airport
Destination Code
Departure Date
Departure Time - Note: Changing the Departure Date/time should programmatically change the arrival date/time
First Class Price
Business Class Price
Main Cabin Price
3. Create methods that will return the following information: - Origin Airport - Origin Code - Destination Airport - Destination Code - Departure Date - Departure Time - Arrival Date - Arrival Time - Duration - Distance - Time Zone Difference - First Class Price - Business Class Price - Main Cabin Price - First Class Seats - Business Class Seats - Main Cabin Seats - Total Seats
4. Create a method called printFlight that will print all the information of the Flight
Origin Airport
Origin Code
Destination Airport
Destination Code
Departure Date
Departure Time
Arrival Date
Arrival Time
Duration
Distance
Time Zone Difference
First Class Price
Business Class Price
Main Cabin Price
First Class Price
Business Class Seats
Main Cabin Seats
Total Seats
5. Read a CSV file with Flight information a. Do not use a library for this part; instead, you should write the code from a CSV file with Flight information scratch. You may use Scanner or File Reader 6. Using the data from the CSV file of Flights, create Flight objects and store them inside a heap map. 7.Create a terminal-based interface that will do the following: 1. Receive input from the user to search for a specific flight by ID 2. Create a small menu that will call the functions that were created as part of the Flight class Please make this intuitive and user friendly
8. Log each action that is taken and write it to a text file For example:
Flight ID XX updated departure date to MM/DD/YYYY
Flight ID XX updated flight origin to International Airport, etc.
This file can be produced upon successful termination of the program
9. Handle exceptions gracefully
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started