-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
48 lines (41 loc) · 1.41 KB
/
Main.java
File metadata and controls
48 lines (41 loc) · 1.41 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
// this is the entry point of the proogram
import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
StudentManager sm = new StudentManager();
while(true) {
System.out.println("\n Student Management System");
System.out.println("1. Add Student");
System.out.println("2. View Students");
System.out.println("3. Search Student");
System.out.println("4. Delete Student");
System.out.println("5. Exit");
System.out.print("Choose an option ji: ");
int choice = sc.nextInt();
switch (choice) {
case 1:
sm.addStudent();
break;
case 2:
sm.viewStudent();
break;
case 3:
sm.searchStudent();
break;
case 4:
sm.deleteStudent();
break;
case 5: {
System.out.println("Exiting...");
sc.close();
System.exit(0);
}
break;
default:
System.out.println("Invalid choice! Please try again.");
}
}
}
}