-
Notifications
You must be signed in to change notification settings - Fork 0
/
Admin.java
93 lines (85 loc) · 3.04 KB
/
Admin.java
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
import java.util.*;
import java.lang.*;
import java.io.*;
class Admin{
public void goMenu(){
System.out.println("====================^^^^^ |||| ADMIN |||| ^^^^^==================");
do{
System.out.println();
System.out.println("(1) Add Students");
System.out.println("(2) Add Faculty");
System.out.println("(3) Add Subject");
System.out.println("(4) Show All Students");
System.out.println("(5) Show All Faculty");
System.out.println("(6) Show All Subjects");
System.out.println("(7) Go Back");
System.out.println();
Scanner s = new Scanner(System.in);
int n = s.nextInt();
switch(n){
case 1:
System.out.println("========================== Add Students =======================");
System.out.println();
System.out.println("Enter the Name : ");
String name = s.next();
System.out.println("Enter the RollNo :");
String rol= s.next();
System.out.println("Enter the Branch :");
String bra = s.next();
System.out.println("Enter the Parent Name :");
String par = s.next();
new Student(name,rol,bra,par);
System.out.println();
break;
case 2:
System.out.println("==========================Add Faculty =========================");
System.out.println();
System.out.println("Enter the Name : ");
String facname= s.next();
System.out.println("Enter the Id");
String id = s.next();
new Faculty(facname,id);
System.out.println();
break;
case 3:
System.out.println("==========================Add Subject =========================");
System.out.println();
System.out.println("Enter the Subject Name");
String subname =s.next();
System.out.println("Enter the Course Code of the Subject");
String course = s.next();
new Subject(subname,course);
System.out.println();
break;
case 4:
System.out.println("======================================= Total Students List ===========================================");
System.out.println();
for(Student stud : Student.totalStudentsList){
System.out.println(stud.getName()+"\t"+stud.getRoll()+"\t"+stud.getBranch()+"\t"+stud.parent.getName());
}
System.out.println();
break;
case 5:
System.out.println("==========================Total Faculty List ==============================");
System.out.println();
for(Faculty fac : Faculty.totalFacultyList){
System.out.println(fac.getName()+" " + fac.getId());
}
System.out.println();
break;
case 6:
System.out.println("==========================Total Subjects List =============================");
System.out.println();
for(Subject sub : Subject.totalSubjectslist){
System.out.println(sub.getsubName());
}
break;
case 7:
return;
default :
System.out.println("Enter Valid number");
}
}
while(true);
}
}