-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTicketUI.java
More file actions
44 lines (35 loc) · 1.17 KB
/
TicketUI.java
File metadata and controls
44 lines (35 loc) · 1.17 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
// TEMP FILE,, code to be transferred to MovieTheatreApp
import java.util.Scanner;
public class TicketUI {
public static void purchaseTicket() {
}
public static void cancelTicket() {
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
boolean exitProgram = false;
while (!exitProgram) {
System.out.println("Would you like to:");
System.out.println("1. Buy a ticket");
System.out.println("2. Cancel a ticket");
System.out.println("3. Exit");
String userChoice = scanner.nextLine().trim();
switch (userChoice) {
case "1":
purchaseTicket();
break;
case "2":
cancelTicket();
break;
case "3":
System.out.println("Exiting the program...");
exitProgram = true;
break;
default:
System.out.println("Invalid choice. Please select 1, 2, or 3.");
break;
}
}
scanner.close();
}
}