-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAapplication.java
157 lines (96 loc) · 3.65 KB
/
Aapplication.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
import java.util.Scanner;
public class Aapplication{
public static void main (String[]args){
loginScreen();
}
static void loginScreen(){
boolean reload= true;
Scanner _input= new Scanner (System.in);
System.out.println("--------------------Welcome to login Screen-----------");
System.out.println();
System.out.println("Enter username");
String username= _input.nextLine();
System.out.println("Enter password");
String password= _input.nextLine();
if(username=="admin"|| username.equals("admin")){
if(password=="admin"|| password.equals("admin")){
maindashboard();
reload=true;
}else{
System.out.println("Invalid password");
}
}else{
System.out.println("Invalid username");
}
while(reload){
System.out.println("Do you want to continue Y/N");
String choice= _input.nextLine();
if(choice=="Y"|| choice.equals("Y")){
loginScreen();
}else{
reload = false;
System.out.println("Program has been terminated");
}
}
}
static void maindashboard(){
Scanner in=new Scanner(System.in);
System.out.println("-----------------------Main dashboard---------------------");
System.out.println();
System.out.println("1. Student Management");
System.out.println("2. Quit");
System.out.println("\n Enter your choice");
Integer choice = in.nextInt();
switch(choice){
case 1:
studentScreen();
break;
case 2:
System.out.println("Program terminated.");
break;
default:
System.out.println("incorrect choide");
}
}
static void studentScreen(){
Scanner in=new Scanner(System.in);
System.out.println("-----------------Student Management----------------");
System.out.println();
System.out.println("1. Create Student");
System.out.println("2. Read all Student");
System.out.println("3. Read Individual Student data");
System.out.println("4. Update Student");
System.out.println("5. Delete Student");
System.out.println("6. Quit");
System.out.println("\n Enter your Choice");
Integer choice= in.nextInt();
switch(choice){
case 1:
createStudent();
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
}
}
static void createStudent(){
Scanner input= new Scanner(System.in);
System.out.println("-----------------create Student-----------");
System.out.println();
System.out.println("First name");
String firstname= input.nextLine();
System.out.println("Last name");
String lastname= input.nextLine();
System.out.println("Address");
String address= input.nextLine();
System.out.println("Phone number");
Integer phoneNumber= input.nextInt();
}
}