-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserderived.cpp
More file actions
454 lines (441 loc) · 12.7 KB
/
userderived.cpp
File metadata and controls
454 lines (441 loc) · 12.7 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
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
#include"userderived.h"
#include<iostream>
#include"customer.h"
//#include"customerderived.h"
//#include"customer_derived1.h"
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<conio.h>
using namespace std;
int n=100;
void Receptionist::login()
{
int t=1;
char a;
system("cls");
cout<<endl;
cout<<"------------------------------------------------------------------------------------------------------------------------";
cout<<"**************************************************RECEPTIONIST DETAILS**************************************************";
cout<<"\n------------------------------------------------------------------------------------------------------------------------";
cout<<endl;
cout<<endl;
int s=0;
do
{
cout<<endl;
cout<<"Enter your name :";
cin>>name;
s=0;
for(int i=0;i<20;i++)
{
if(isdigit(name[i])==1)
{
cout<<"\nSorry!!Invalid Name";
cout<<"\nEnter only characters ";
/*cout<<"\n Enter your name:";
cin>>name;*/
s=1;
break;
}
}
}while(s==1);
cout<<endl;
cout<<"Enter id :";
cin>>id;
cout<<endl;
// cout<<"Enter the login details";
// cout<<endl;
system("cls");
cout<<endl;
cout<<"------------------------------------------------------------------------------------------------------------------------";
cout<<"**************************************************LOGIN DETAILS******************************************************";
cout<<"\n------------------------------------------------------------------------------------------------------------------------";
cout<<endl;
cout<<"\t\t\t\tENTER THE LOGIN DETAILS:";
cout<<endl;
do
{
cout<<endl;
cout<<"\t\t\t\tUSERNAME :";
cin>>username;
cout<<endl;
cout<<"\n";
cout<<"\t\t\t\tPASSWORD :";
{
for(int i=0;i<3;i++)
{
a=_getch();
password[i]=a;
cout<<"*";
}
}
//cout<<password;
if(strcmp(username,"rrr")==0)
if(strcmp(password,"rrr")==0)
{
cout<<endl;
t=0;
cout<<"\n";
cout<<"\t\t\t\tLOGGED IN AS RECEPTIONIST";
cout<<endl;
system("pause");
cout<<endl;
displaymenu();
}
else
{
cout<<endl;
t=1;
cout<<"Sorry,Wrong password!!";
cout<<endl;
}
else
{
cout<<endl;
t=1;
cout<<"Sorry,Wrong username!!";
cout<<endl;
}
}while(t==1);
}
void Manager::login()
{
int t=1;
char a;
system("cls");
cout<<endl;
cout<<"------------------------------------------------------------------------------------------------------------------------";
cout<<"**************************************************MANAGER DETAILS******************************************************";
cout<<"\n------------------------------------------------------------------------------------------------------------------------";
cout<<endl;
int s=0;
do
{
cout<<endl;
cout<<"Enter your name :";
cin>>name;
s=0;
for(int i=0;i<20;i++)
{
if(isdigit(name[i])==1)
{
cout<<"\nSorry!!Invalid Name";
cout<<"\nEnter only characters ";
/*cout<<"\n Enter your name:";
cin>>name;*/
s=1;
break;
}
}
}while(s==1);
cout<<endl;
cout<<"Enter id :";
cin>>id;
cout<<endl;
//char a;
system("cls");
cout<<endl;
cout<<"------------------------------------------------------------------------------------------------------------------------";
cout<<"**************************************************LOGIN DETAILS******************************************************";
cout<<"\n------------------------------------------------------------------------------------------------------------------------";
cout<<endl;
cout<<"Enter the login details :";
cout<<endl;
do
{
cout<<"\t\t\t\tUSERNAME :";
cin>>username;
cout<<endl;
cout<<"\t\t\t\tPASSWORD :";
{
for(int i=0;i<7;i++)
{
char b='\0';
b=_getch();
password[i]=b;
cout<<"*";
}
}
cout<<password;
if(strcmp(username,"manager")==0)
if(strcmp(password,"manager")==0)
{
cout<<endl;
cout<<endl;
t=0;
cout<<"\t\t\tLOGGED IN AS MANAGER";
cout<<endl;
cout<<"\n";
system("pause");
cout<<endl;
displaymenu();
}
else
{
cout<<endl;
t=1;
cout<<"Wrong password";
cout<<endl;
}
else
{
cout<<endl;
t=1;
cout<<"Wrong username";
cout<<endl;
}
}while(t==1);
}
void Receptionist::displaymenu()
{
int t=1;
int ch;
system("cls");
cout<<endl;
cout<<"\t\t\t\t*****************RECEPTIONIST DISPLAY MENU****************";
cout<<endl;
cout<<"\n\t\t\t\t----------------------------------------------------------";
do
{
cout<<endl;
cout<<"\t\t\t\t||------------------------------------------------------||";
cout<<endl;
cout<<"\t\t\t\t||\t\t1.BOOK ROOM\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t2.CHECK OUT\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t3.DISPLAY CUSTOMER DETAILS\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t4.MODIFY CUSTOMER DETAILS\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t5.DELETE RECORD\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t6.ORDER FOOD\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t7.EXIT\t\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||------------------------------------------------------||";
cout<<endl;
cout<<"\t\t\t\t----------------------------------------------------------";
cout<<endl;
cout<<"\nEnter the choice :";
cin>>ch;
switch(ch)
{
case 1:bookroom();
t=0;
system("cls");
displaymenu();
break;
case 2:checkout();
system("cls");
displaymenu();
t=0;
break;
case 3:display_customer_details();
system("cls");
t=0;
displaymenu();
break;
case 4:modify_customer_details();
system("cls");
t=0;
displaymenu();
break;
case 7://exit();
t=0;
break;
case 5:delete_record();
t=0;
displaymenu();
break;
case 6:order();
t=0;
displaymenu();
break;
default:cout<<"\nEnter only valid choice ";
break;
}
}while(t==1);
}
void Receptionist::bookroom()
{
/* char type;
cout<<"\nEnter customer type (foreigner-f,Indian-i) :";
cin>>type;
if(type=='f')
{
c=new foreigners;
c->Check_in();
}
else
{
c=new nonforeigners;
c->Check_in();
}*/
c=new Customer[n];
c->Check_in(c,n);
}
void Receptionist::display_customer_details()
{
system("cls");
int ch;
cout<<"\n************************************************** DISPLAY MENU*********************************************************";
cout<<"\n";
cout<<"1.PARTICULAR CUSTOMER RECORD";
cout<<"\n";
cout<<"2.DISPLAY ALL CUSTOMER RECORD";
cout<<endl;
cin>>ch;
// int ch;
switch(ch)
{
case 2: c->displaycustomerdetails(c,n);
displaymenu();
break;
case 1:c->display();
displaymenu();
break;
}
}
void Manager::displaymenu()
{
int t=1;
int ch;
system("cls");
cout<<endl;
cout<<"**********************************************MANAGER DISPLAY MENU******************************************************";
cout<<endl;
cout<<"\n\t\t\t\t----------------------------------------------------------";
cout<<endl;
do
{
cout<<"\t\t\t\t||\t\t1.DISPLAY CUSTOMER DETAILS\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t2.ORDER STOCK\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t3.DISPLAY ORDERED STOCK\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t4.COMPLAIN RECORD\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t5.CHECK FOOD MENU\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||\t\t6.EXIT\t\t\t\t\t||";
cout<<endl;
cout<<"\t\t\t\t||------------------------------------------------------||";
cout<<endl;
cout<<"\t\t\t\t----------------------------------------------------------";
cout<<endl;
cout<<"\nEnter your choice :";
cin>>ch;
switch(ch)
{
case 2:purchase_stock();
t=0;
system("cls");
displaymenu();
break;
case 1:display_customer_details();
t=0;
system("cls");
displaymenu();
break;
case 3:display_stock();
system("cls");
t=0;
displaymenu();
break;
case 4:complain_record();
system("cls");
t=0;
displaymenu();
case 5:check_food_menu();
system("cls");
system("cls");
t=0;
displaymenu();
break;
case 6:t=0;
//system("cls");
break;
default:cout<<"\nEnter only valid choice ";
break;
}
}while(t==1);
}
/*void Manager::display_customer_details()
{
c->displaycustomerdetails();
}*/
void Manager::purchase_stock()
{
int n;
cout<<"\nEnter the no.of stock you want to purchase :";
cin>>n;
s=new stock[n];
s->read(s,n);
}
void Manager::display_stock()
{
s->display(s,n);
}
void Manager::display_customer_details()
{
c->displaycustomerdetails(c,n);
}
void Manager::complain_record()
{
char ch[100000];
char name1[20];
system("cls");
cout<<"\n\t\t\t\t---------------------COMPLAIN RECORD-----------------------";
cout<<"\n\t\t\tEnter the customer name :";
cin>>name1;
cout<<"\n\t\t\tEnter your complain :";
cin.ignore();
cin.getline(ch,100000);
cout<<"\nComplain has been recorded ";
cout<<"\nThank you! Will look into it as soon as possible";
cout<<endl;
system("pause");
}
void Receptionist::checkout()
{
c->generatebill();
}
void Receptionist::modify_customer_details()
{
c->modify();
}
void Receptionist::delete_record()
{
c->delete_record();
}
void Manager::check_food_menu()
{
system("cls");
cout<<"\n\t\t\t***********************FOOD MENU******************************";
int ch;
cout<<"\n\t\t\t\t1.APPEND FOOD MENU";
cout<<"\n\t\t\t\t2.DISPLAY ALL CONTENTS";
cout<<"\n";
cout<<"\nEnter your choice :";
cin>>ch;
f=new Food_items;
switch(ch)
{
case 1:f->input();
break;
case 2:f->display_all();
break;
default:cout<<"\nEnter only valid choice ";
break;
}
}
void Receptionist::order()
{
f=new Food_items;
f->display_all();
c->Order_fooditem();
}