Page 1 of 1

user input. Perform the following tasks: 1. Create a Java project called CSlIProject which contains the main class. 2. C

Posted: Tue Jul 12, 2022 8:05 am
by answerhappygod
user input.
Perform the following tasks:
1. Create a Java project called CSlIProject which contains the main class.
2. Create another class of enum type named "Flight"
a. Declare the enum with 10 distinct values from your choice separated by
a comma.
For example:
F1 ("Dammam" "Beirut" "MEA" "17:20" "19:50" 2500).
F2 ("Dammam". "Toronto"
"Saudia", "12:00" "23:15" 4200),
F3("Dammam", "Beirut", "FlyNas", "10:30","13:10",1800);
b. Create instance variable of type 'private and final' named:
Departure, destination, airline, departure time, arrival time and price;
c. Create a constructor of type Flight and give values for all the instance
variables
d. Create getters for all the instance variables
3. In the class "CSIIProject": Create a method called "Menu" to ask the user
"To terminate, enter 1
To retrieve by Airline, enter 2
To retrieve by Departure city, enter 3
To retrieve by Arrival city, enter 4"
4. In the main of "CSIIProject" class declare the enum Flight as following :
Flight[] flight = Flight.values();
5. Create three methods called byDeparture, byDestination and byAirlines of
type void which takes into parameters two variables (Hint: the second
variable is the enum). Inside each method, using a loop, display the output.
6. In a loop, call the method "menu" and using Switch statement ask the user
to enter the airlines, or the departure City or the Arrival City. The
appropriate methods must be called in each switch statement. On the
other hand, the 'default' is reserved for any invalid input