-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
134 lines (125 loc) · 4.56 KB
/
main.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
#include <iostream>
#include<cstring>
#include <conio.h>
#include "classes.h"
using namespace std;
int main()
{
cout<<"____________________________________________________________________________________\n";
cout<<"*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_\n\n";
cout << " HH HH MM MM SSSSSSS \n";
cout << " HH HH MMMM MMMM SS \n";
cout << " HHHHHHHHH MM MM MM SSSSSSS \n";
cout << " HH HH MM MM SS \n";
cout << " HH HH MM MM SSSSSSS \n";
cout<<"*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_\n";
cout<<"____________________________________________________________________________________\n\n"
"";
getch();
admin a; //objects of all classes
doctor d;
patient p;
accountant acc;
nurse n;
int ch; //int variable to take choice from user
char pass[15]; //char array to take in password
do{
system("CLS");
cout << "_______________________________________________________________________________\n";
cout << "_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_\n";
cout << "\t\t\t\tMAIN MENU\n ";
cout << "_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_*_\n";
cout << "_______________________________________________________________________________";
cout<<"\t\t\n";
cout<<"\t\t1.___.Admin.\n";
cout<<"\t\t2.___.patient.\n";
cout<<"\t\t3.___.Doctor.\n";
cout<<"\t\t4.___.Accountant.\n";
cout<<"\t\t5.___.Nurse.\n";
cout<<"\t\t6.___.Exit. \n";
cout<<"\t\tChoice : \n";
cin>>ch;
switch(ch){
case 1:
login1:
cout<<"Enter ADMIN password: ";
cin>>pass; //enter password
if(strcmp(pass,"admin")==0) //strcmp function to authenticate password
{
system("cls");
a.admin_menu(); //call of admin 's menu
}
else
{
cout<<"WRONG PASSWORD!!!\n";
goto login1;
}
break;
case 2:
login2:
cout<<"Enter Patient password: ";
cin>>pass;
if(strcmp(pass,"patient")==0) //strcmp function to authenticate password
{
system("cls");
p.patient_menu(); //call of patient 's menu
}
else
{
cout<<"WRONG PASSWORD!!!\n";
goto login2;
}
break;
case 3:
login3:
cout<<"Enter Doctor password: ";
cin>>pass;
if(strcmp(pass,"doctor")==0) //strcmp function to authenticate password
{
system("cls");
d.doctor_menu(); //call of doctor 's menu
}
else
{
cout<<"WRONG PASSWORD!!!\n";
goto login3;
}
break;
case 4:
login4:
cout<<"Enter Accountant password: ";
cin>>pass;
if(strcmp(pass,"accountant")==0) //strcmp function to authenticate password
{
system("cls");
acc.Acc_menu(); //call of accountant 's menu
}
else
{
cout<<"WRONG PASSWORD!!!\n";
goto login4;
}
break;
case 5:
login5:
cout<<"Enter Nurse password: ";
cin>>pass;
if(strcmp(pass,"nurse")==0) //strcmp function to authenticate password
{
system("cls");
n.nurse_menu(); //call of nurse's menu
}
else
{
cout<<"WRONG PASSWORD!!!\n";
goto login5;
}
break;
}
}while(ch!=6);
system("cls");
system_end();
getch();
system("cls");
return 0;
}