-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
33 lines (29 loc) · 929 Bytes
/
Main.java
File metadata and controls
33 lines (29 loc) · 929 Bytes
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
import View.*;
import Controller.*;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
UserView userView = new UserView();
UserController userController = new UserController(userView);
while (true) {
userView.displayMenu();
Scanner scanner = new Scanner(System.in);
int option = scanner.nextInt();
scanner.nextLine(); // Consume newline
scanner.close();
switch (option) {
case 1:
userController.login();
break;
case 2:
userController.register();
break;
case 3:
System.out.println("Exiting...");
return;
default:
userView.displayInvalidOption();
}
}
}
}