-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
61 lines (60 loc) · 2.35 KB
/
Main.java
File metadata and controls
61 lines (60 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
ReservationList reservationList = new ReservationList();
FlightList flightList = new FlightList(reservationList);
Menu menu = new Menu();
Scanner sc = new Scanner(System.in);
while(true) {
int mainchoice = menu.displayMainMenu();
switch(mainchoice) {
case 1:
flightList.addFlight();
break;
case 2:
while(true) {
int choiceTwo = menu.displayOption2();
switch(choiceTwo) {
case 1:
reservationList.searchFlights();
break;
case 2:
reservationList.reserveFlight();
break;
case 3:
System.out.println("Returning to Main Menu...");
break;
default:
System.out.println("Invalid choice. Please try again.");
}
if(choiceTwo == 3) {
break;
}
}
break;
case 3:
reservationList.checkIn();
break;
case 4:
flightList.manageCrew();
break;
case 5:
System.out.println("Saving...");
System.out.println("Passenger information saved to ReservationID.txt");
System.out.println("Flight details saved to FlightDetails.txt");
System.out.println("Seat maps saved to SeatMap.txt");
break;
case 6:
flightList.printAllListsFromFile();
break;
case 7:
sc.close();
System.exit(0);
break;
default:
System.out.println("Invalid choice. Please try again.");
break;
}
}
}
}