-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
29 lines (25 loc) · 1017 Bytes
/
Main.java
File metadata and controls
29 lines (25 loc) · 1017 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
// Main.java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
StudentManager manager = new StudentManager();
Scanner scanner = new Scanner(System.in);
int choice;
do {
System.out.println("\n===== Student Record System =====");
System.out.println("1. Add Student");
System.out.println("2. View All Students");
System.out.println("3. Search Student");
System.out.println("4. Exit");
System.out.print("Enter choice: ");
choice = Integer.parseInt(scanner.nextLine());
switch (choice) {
case 1 -> manager.addStudent();
case 2 -> manager.viewAll();
case 3 -> manager.searchStudent();
case 4 -> System.out.println("👋 Exiting... Thank you!");
default -> System.out.println("❗ Invalid choice. Please try again.");
}
} while (choice != 4);
}
}