-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (61 loc) · 1.34 KB
/
main.cpp
File metadata and controls
63 lines (61 loc) · 1.34 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include "Guest.h"
#include "Admin.h"
int main() {
system("color 09");
int user, singUp, logIn; Admin admin; Guest guest;
do {
cout << " >>> Menu <<<\n";
cout << " 1. Sing Up\n 2. Log In\n 3. Exit\n";
cout << " ?: "; cin >> user;
switch (user) {
case 1:
system("cls");
if (admin.getIsAdmin() == false) {
cout << " >>> Choose person <<<\n";
cout << " 1. Admin\n 2. Guest\n 3. Exit\n";
cout << " ?: "; cin >> singUp;
} else singUp = 2;
switch (singUp) {
case 1:
system("cls");
admin.registerAdmin();
break;
case 2:
guest.registerGuest();
admin.addGuest(guest);
break;
case 3:
system("cls");
break;
default:
cerr << " error: wrong option, re-enter opt: "; cin >> singUp;
break;
} break;
case 2:
system("cls");
cout << " >>> Choose person <<<\n";
cout << " 1. Login As Admin\n 2. Login As Guest\n 3. Return\n";
cout << " ?: "; cin >> logIn;
switch (logIn) {
case 1:
system("cls");
admin.loginAdmin();
break;
case 2:
//guest.loginGuest();
break;
/*case 3:
return;*/
default:
cerr << " error: wrong option, re-enter opt: "; cin >> logIn;
break;
} break;
case 3:
cout << "\n >>> Bye <<<\n";
return 0;
default:
cerr << " error: wrong option, re-enter opt: "; cin >> user;
break;
}
} while (user != 3);
}