Perform the following tasks: 1. Create a Java project called CSIIProject which contains the main class. 2. Create anothe
Posted: Sun Jul 10, 2022 11:27 am
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 Your output must me as the following: run: Welcome to the project of CS2 To terminate, enter 1 To retrieve by Airline, enter 2 To retrieve by Departure city, enter 3 To retrieve by Arrival city, enter 4 2
Perform the following tasks: 1. Create a Java project called CSIIProject 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 "CSHIProject": 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 by Departure, 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