-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
44 lines (41 loc) · 1.39 KB
/
Copy pathMain.java
File metadata and controls
44 lines (41 loc) · 1.39 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
import java.util.Scanner;
public class Main {
public static void displayMenu() {
System.out.println("1. Add student");
System.out.println("2. Update information about student");
System.out.println("3. Delete student from ID");
System.out.println("4. Arrange student from name");
System.out.println("5. Display list of student");
System.out.println("6. Quit");
}
public static void main(String[] args) {
Handle handle = new Handle();
boolean programme = true;
Scanner sc = new Scanner(System.in);
while (programme) {
try {
Main.displayMenu();
int choice = Integer.parseInt(sc.nextLine());
switch (choice) {
case 1:
handle.addStudent();
break;
case 2:
handle.updateStudent();
break;
case 3:
handle.destroyById();
break;
case 4:
handle.sortName();
break;
case 5:
handle.outStudent();
break;
}
} catch (Exception e) {
System.out.println("Error, restart menu");
}
}
}
}