source airport destination airport
Note that multiple airlines may fly the same route on the same day.
airlines flightId date seats
The Flight class cannot have its own source and destination airport fields. These fields must be inherited from the parent class.
No Routes between source and destination.source and destination are replaced by the source and destination cities respectively. See example below. You do not need to check for connecting routes.
No Flights between source and destination on travel date.
source and destination are replaced by the source and destination cities respectively. travel date is replaced by the travel date. See example below.
Insufficient tickets available. Flight not booked.
10 SFO SJC SOUTHWEST 1 03292015 SFO SJC LUFTHANSA 2 03292015 SJC JFK AIRCANADA 3 03302015 JFK SNA AIRFRANCE 4 04302015 JFK PIT UNITED 5 04302015 PIT JFK DELTA 6 04302015 SJC JFK DELTA 7 03302015 JFK PIT DELTA 8 04302015 SJC SFO SOUTHWEST 9 03292015 SFO SJC DELTA 10 03302015 y SFO SJC 03292015 1 80 y JFK PIT 03292015 y JFK PIT 04302015 5 130 y SNA SNA n
java AirBooking < airline_input1.txt Do you wish to book another flight (y/n)? Enter source, destination: Enter departure date (mmddyyyy): Flights from SFO to SJC on 03292015 Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 100 Airline is LUFTHANSA and FlightID is 2 and Seats_Remaining is 100 Enter Flight ID and number of tickets to book Tickets Successfully booked on FlightId 1 and updated status for Flight is: Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 20 Do you wish to book another flight (y/n)? Enter source, destination: Enter departure date (mmddyyyy): No Flights between JFK and PIT on 03292015 Do you wish to book another flight (y/n)? Enter source, destination: Enter departure date (mmddyyyy): Flights from JFK to PIT on 04302015 Airline is UNITED and FlightID is 5 and Seats_Remaining is 100 Airline is DELTA and FlightID is 8 and Seats_Remaining is 100 Enter Flight ID and number of tickets to book Insufficient tickets available. Flight not booked. Do you wish to book another flight (y/n)? Enter source, destination: No Routes between SNA and SNA Do you wish to book another flight (y/n)? bye
You may get Bonus points if you check for existence of indirect routes in case of absence of direct routes. Here is a sample input and expected output Input2: 6 SFO SJC SOUTHWEST 1 03292015 SJC PIT UNITED 2 03292015 SJC PIT BRITISH 3 03292015 SFO JFK DELTA 4 03292015 JFK PIT DELTA 5 04302015 JFK PIT DELTA 6 03292015 y SFO PIT 03292015 1 2 80 y JFK PIT 03292015 6 130 y SFO SFO y SFO SJC 03292015 1 5 y SFO SJC 03292016 n Expected Output: Do you wish to book another flight (y/n)? Enter source, destination Enter departure date (mmddyyyy): No Direct Flights between SFO and PIT on 03292015 Indirect flights are available as IndirectPair: 1: SFO SJC: Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 100 SJC PIT: Airline is UNITED and FlightID is 2 and Seats_Remaining is 100 IndirectPair: 2: SFO SJC: Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 100 SJC PIT: Airline is BRITISH and FlightID is 3 and Seats_Remaining is 100 IndirectPair: 3: SFO JFK: Airline is DELTA and FlightID is 4 and Seats_Remaining is 100 JFK PIT: Airline is DELTA and FlightID is 6 and Seats_Remaining is 100 Enter Flight IDs of the two Flights and number of tickets to book Tickets Successfully booked on FlightId 1 and updated status for Flight is Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 20 Tickets Successfully booked on FlightId 2 and updated status for Flight is Airline is UNITED and FlightID is 2 and Seats_Remaining is 20 Do you wish to book another flight (y/n)? Enter source, destination Enter departure date (mmddyyyy): Flights from JFK to PIT on 03292015 Airline is DELTA and FlightID is 6 and Seats_Remaining is 100 Enter Flight ID and number of tickets to book Insufficient tickets available. Flight not booked. Do you wish to book another flight (y/n)? Enter source, destination No Routes between SFO and SFO Do you wish to book another flight (y/n)? Enter source, destination Enter departure date (mmddyyyy): Flights from SFO to SJC on 03292015 Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 20 Enter Flight ID and number of tickets to book Tickets Successfully booked on FlightId 1 and updated status for Flight is Airline is SOUTHWEST and FlightID is 1 and Seats_Remaining is 15 Do you wish to book another flight (y/n)? Enter source, destination Enter departure date (mmddyyyy): No Flights between SFO and SJC on 03292016 Do you wish to book another flight (y/n)? bye
submit cmps012a-ap.w15 lab5 AirBooking.java
Make sure that for this program, and all other programs you write for CMPS 12A this quarter, have been recompiled and tested on unix.ic.ucsc.edu before submission.
20 -- documentation and comments 40 -- use inheritance 10 -- checks for No Routes available 10 -- checks for No Flights available on that date 10 -- checks for Insufficient Tickets available 10 -- correctly books tickets and displays updated status -100 IF MANUAL PROCESSING IS REQUIRED Who Will Grade What: --------------------Ryan : aalkahel - dlopez8 Kara : dlskilli - jssorens Derek : jtorre34 - romarks Eitan : rpickett - zwang58