Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The program, airline _ project.java, has been started for you and included with this assignment. The assignment will also use the data file, flights.txt ,

The program, airline_project.java, has been started for you and included with this assignment. The assignment will also use the data file, flights.txt, which is also included with this assignment. The entire structure of the program has been created for you. The program contains stubs (a method that runs, but does not do anything except run at the proper time). Therefore, you must add the proper code to each method to perform the required actions listed below.
Flight information that must be defined in your main method is below. You must also add a count to keep track of how many flights were read in. The data MUST be defined in the main method and passed to the methods that need them.
Flight number
Flight origination city
Flight destination city
Flight date
Flight time
Number of coach seats on flight
Cost of each coach seat
Number of first class seats on flight
Additional cost of first class seats
You must complete the methods as follows:
start_program- This method will open the data file flights.txt and read flight information into a set of parallel arrays. ALL WORK required in other sections of the code is then performed on the parallel arrays. You will ONLY refer to the flights.txt data file in this start_program method. The data file is stored with this assignment and must be copied into the main folder of your Java project. Please note that a copy of the data stored in the data file is included at the end of this assignment document for your info.
print_all_info This method will print all information that was read into the flight arrays
print_specific_flight_info- This method will print all information on a specific flight. You will have to prompt the user for the flight number and search the arrays for the flight
print_destination This method will print all information on all flights going to a specific city. You will have to prompt the user for the destination city and search the arrays for the destination city
print_total_seats For each flight, this method will print the flight number and the destination of the flight along with the total number of seats on the flight (coach + first class seats)
print_seat_value For each flight, this method will print all information on the flight and calculate the value of the coach seats (number of coach seats multiplied by the cost of the coach seats) and the value of all the first class seats on the flight. (A cost of one first class seat is the cost of the coach seat plus the additional cost that was read in)
Contents of the flights.txt data file:
1234#Pittsburgh#Phoenix#04/02/23#10:30am#108#599#8#500#
4567#Boston#New York#04/03/23#18:10am#210#199#12#400#
9876#Pittsburgh#Seattle#04/04/23#1:30pm#110#549#12#600#
8888#Chicago#Pittsburgh#04/05/23#2:45pm#106#399#8#500#
7777#Pittsburgh#Miami#04/06/23#9:35am#116#459#16#1000#
2892#Las Vegas#New York#04/07/23#8:10pm#107#489#4#600#
4444#Pittsburgh#San Francisco#04/23/23#5:55pm#124#699#12#450#
2323#Atlanta#New York#04/09/23#4:30pm#110#475#16#500#
9281#Pittsburgh#Seattle#04/11/23#2:15pm#216#890#8#1000#
1000#Pittsburgh#Phoenix#04/12/23#3:25pm#150#499#8#500#

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

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

f@) 7 is continuous everywhere.

Answered: 1 week ago

Question

3. What should a contract of employment contain?

Answered: 1 week ago

Question

1. What does the term employment relationship mean?

Answered: 1 week ago