Submissions that do not compile can receive as much as a 50% deduction.
| Variable Name | Meaning |
|---|---|
| orig | Airport of Origin |
| dest | Airport of Destination |
| day | Day of Flight Departure |
| depart | Departure Time |
| arrive | Arrival Time |
| price | Price of Flight |
Include these methods: parameterized constructor, getters for all instance variables, a setter for price and a toString method. Also include a main method within the Flight class that tests all of the methods.
Note: This class is different than the ones we have written until now. The main method is included in the class, rather than placed in a separate test class.
Instantiate the Flight array.
It should hold at least 417 elements.
Populate the Flight array with data
from flights.txt.
While(true)
Prompt user to enter airport of origin.
Input origin to search.
Prompt user to enter airport of destination.
Input destination to search.
Prompt user to enter day of flight.
Input day to search.
Print the departure time, arrival time
and price for all flights that match
the entered criteria.
End while.
Use control-c to exit the program.
> javac Flight.java > javac CheckFlights.java > java CheckFlights Enter Airport of Origin: ORD Enter Airport of Destination: DFW Enter Day of Flight: MON Departure: 0740 Arrival: 0950 Price: 120.00 Departure: 1410 Arrival: 1620 Price: 120.00