-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnewMenu.cpp
158 lines (111 loc) · 4.17 KB
/
newMenu.cpp
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
158
#include "newMenu.h"
#include "newMenu.h"
#include <iostream>
#include <string>
#include "Student.h"
#include "InputOutput.h"
#include "Head.h"
using namespace std;
InputOutput IO;
Head h ("Baris","Manco",68,"[email protected]");
void newMenu :: verification(string usr,string psw){
string username,pass;
cout<<"Please enter your username : ";
cin>>username;
cout<<"Please enter your password : ";
cin>>pass;
if(username==usr && pass==psw){
cout<<"Login successful"<<endl;
}
else{
cout<<"Wrong password or username..."<<endl<<"Program is terminating"<<endl;
exit(0);
}
}
void newMenu :: ExtraChoice(){
int ops;
cout << "\n\t\t**************************************************";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 1_)Return Main Menu *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 2_)Exit *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**************************************************\n\n";
cout<<"Please enter your choice...";
cin>>ops;
switch(ops){
case 1:
newMenu::opening();
break;
case 2:
cout<<"Program is terminating";
exit(0);
break;
default:
newMenu::ExtraChoice();
break;
}
}
void newMenu :: opening(){
system("CLS");
cout << "\n\t\t**************************************************";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 1_)Add Student *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 2_)Display Student *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 3_)Erase Student *****";//
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 4_)Add Instructor *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 5_)Display Instructor *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 6_)Erase Instructor *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** 7_)Exit *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**** *****";
cout << "\n\t\t**************************************************\n\n";
int option=0;
cout<<"Please enter your choice"<<endl;
cin>>option;
InputOutput IO;
if(option==1){
int i;
newMenu::verification(h.getUsername(),h.getPassword());
IO.AddStudent();
newMenu::ExtraChoice();
}
else if(option==2){
system("CLS");
newMenu::verification(h.getUsername(),h.getPassword());
cout<<"---List of students---";
IO.displayStudent();
newMenu::ExtraChoice();
}
else if(option==3){
newMenu::verification(h.getUsername(),h.getPassword());
InputOutput IO;
IO.EraseStudent();
newMenu::ExtraChoice();
}
else if(option==4){
newMenu::verification(h.getUsername(),h.getPassword());
InputOutput IO;
IO.AddInstructor();
newMenu::ExtraChoice();
}
else if(option==5){
newMenu::verification(h.getUsername(),h.getPassword());
IO.DisplayInstructor();
newMenu::ExtraChoice();
}
else if(option==6){
newMenu::verification(h.getUsername(),h.getPassword());
IO.EraseInstructor();
newMenu::ExtraChoice();
}
else if(option==7){
exit(0);
}
}