-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
177 lines (154 loc) · 4.77 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#include <iostream>
#include "FBR.h"
using namespace std;
int main()
{
Farmer A[6];
Officer B[6];
BusinessMan C[6];
//DataBack
for(int x=0;x<size;)
{
A[x].farmerBack(x);
B[x].OfficerBack(x);
C[x].BMBack(x);
x++;
}
string nam;
do
{
system("cls");
cout<<"===================================================================================================================================================="<<endl;
cout<<"===================================================================================================================================================="<<endl;
cout<<" *************** ******** ***********"<<endl;
cout<<" ************** *********** *************"<<endl;
cout<<" ** ** **** ** ******"<<endl;
cout<<" ** ** **** ** *****"<<endl;
cout<<" ** ** ***** ** *****"<<endl;
cout<<" ** ** ***** ** *****"<<endl;
cout<<" ************** ******* ** *****"<<endl;
cout<<" ************** *********** ******"<<endl;
cout<<" ** ** ***** ** ****"<<endl;
cout<<" ** ** **** ** *****"<<endl;
cout<<" ** ** ***** ** ****"<<endl;
cout<<" ** ********* ** ****"<<endl;
cout<<" ** ***** ** ****"<<endl;
cout<<"===================================================================================================================================================="<<endl;
cout<<"===================================================================================================================================================="<<endl;
cout<<endl<<" Enter User Name: ";
cin>>nam;
if(nam=="Hassaan")
break;
else if(nam=="Afroz")
break;
else if(nam=="Soman")
break;
else if(nam=="Solat")
break;
else
cout<<"User Name Does not Exist Please Enter Again:"<<endl;
}while(nam!="Hassaan" && nam!="Afroz" && nam!="Soman" && nam!="Solat");
string pass;
int turn=3;
while(turn>0)
{
string choice;
cout<<" Enter Password: ";
cin>>pass;
if ((pass=="k163633" && nam=="Hassaan") || (pass=="1234" && nam=="Solat"))
{
cout<<" Login Succesfull."<<endl;
Admin *Ad=new Admin(A,B,C);
while(1)
{
turn=0;
do
{
cout<<" What Do You Want To Do?"<<endl<<" 1. Edit:\n 2.Register An Account:\n 3. Compensate:\n 4. Display Data:\n 5. Logout \n";
cout<<" Your Choice: ";
cin>>choice;
}
while(choice!="1" && choice!="2" && choice!="3" && choice!="4" && choice!="5");
if(choice=="1")
Ad->Edit();
else if (choice=="2")
Ad->Register(A,B,C);
else if(choice=="3")
Ad->Compensate();
else if(choice=="4")
Ad->Display();
else if(choice=="5")
break;
}
delete Ad;
}
else if (pass=="k163643" && nam=="Afroz" )
{
cout<<"Login Succesfull."<<endl;
Manager *Ad=new Manager(A,B,C);
turn=0;
while(1)
{
do
{
cout<<" What Do You Want To Do?"<<endl<<" 1. Edit:\n 2. Request:\n 3. Compensate:\n 4. Display Data:\n 5. Logout: \n";
cout<<" Your Choice: ";
cin>>choice;
}while(choice!="1" && choice!="2" && choice!="3" && choice!="4" && choice!="5");
if(choice=="1")
Ad->Edit();
else if (choice=="2")
Ad->Request();
else if(choice=="3")
Ad->Compensate();
else if(choice=="4")
Ad->Display();
else if(choice=="5")
break;
}
delete Ad;
}
else if (pass=="k163639" && nam=="Soman")
{
FBRWorker *Ad=new FBRWorker(A,B,C);
cout<<"Login Succesfull."<<endl;
turn=0;
while(1)
{
do
{
cout<<" What Do You Want To Do?"<<endl<<" 1. Display Data\n 2. Tax Collect\n 3. Queries:\n 4. Logout\n";
cout<<" Your Choice: ";
cin>>choice;
}while(choice!="1" && choice!="2" && choice!="3" && choice!="4" && choice!="5");
if(choice=="1")
Ad->Display();
else if (choice=="2")
Ad->TaxCollect();
else if(choice=="3")
Ad->Queries();
else if(choice=="4")
break;
}
delete Ad;
}
else
{
cout<<endl<<"Enter Correct Password Again:"<<endl<<turn<< "Turns remaining: ";
}
turn--;
}
if(turn==0)
{
cout<<"Try again Later."<<endl;
}
//DataPrint
for(int x=0;x<size;)
{
A[x].PrintOnFileFarmer(x);
B[x].PrintOnFileOfficer(x);
C[x].PrintOnFileBM(x);
x++;
}
return 0;
}