-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleProgramPersonnel_ObjectOriented.cpp
More file actions
739 lines (721 loc) · 21.9 KB
/
SimpleProgramPersonnel_ObjectOriented.cpp
File metadata and controls
739 lines (721 loc) · 21.9 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
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
/*
Advanced Programming
project:
A simple program personnel (Object-oriented)
Professor:
Mr. Mehdi Myrzabaky
Student:
Hiwa Amiri
*/
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int n, temp;
class Employee;
class Personnel;
class Finance;
void switch1 (Employee* e[],Personnel &p,Finance &f );
void set (Employee* e[]);
void change (Employee* e[]);
void showall (Employee* e[],Personnel &p);
void morakhasi (Employee* e[],Personnel &p);
void ezafe (Employee* e[],Personnel &p);
void gheybat (Employee* e[],Personnel &p);
void entesabe (Employee* e[],Personnel &p);
void tarfii (Employee* e[],Personnel &p);
void faot (Employee* e[],Personnel &p);
void bazneshastegi (Employee* e[],Personnel &p);
void bazkharid (Employee* e[],Personnel &p);
void ekhraje (Employee* e[],Personnel &p);
void hoghoogh (Employee* e[],Finance &f);
void fish (Employee* e[],Finance &f);
void gozarshShH (Employee* e[],Finance &f);
void pardakhti (Employee* e[],Finance &f);
void azayerefah (Employee* e[],Finance &f);
//**************************************************************class EMPLOYEE****************************
class Employee{
friend class Personnel;
friend class Finance;
private:
static int counter;
long int Number;
char IDNumber[30];
char cellphone[30];
long int BasicEarning;
char HAddress[101];
char employment[11];
char employmentType[21];
char Post[21];
char Accountnumber[21];
long int pl;
long int mi;
bool joinRefah;
public:
char Name[51];
void setinfo();
void changeinfo(Employee&);
Employee(){
mi=0;
pl=0;
counter++;
Number=counter;}
};
int Employee::counter=1000;
void Employee::setinfo (){
system("cls");
cout<<"\n\t***************************************************"
<<"\n\t\t samane sabtename persone"<<endl;
int post,typeemploy,refah;
cout<<"\n etela'ate zir ra vared konid: "<<endl ;
cout<<"\n naam va nameKhanevadegi: " ,scanf("%s",&Name) ;
cout<<"\n shomare shenasnameh: " ,scanf("%s",&IDNumber) ;
cout<<"\n adrese mahale sokounat: " ,scanf("%s",&HAddress) ;
cout<<"\n shomare mobile: " ,scanf("%s",&cellphone) ;
cout<<"\n tarikhe estekhdam: " ,scanf("%s",&employment);
cout<<"\n shomare hesabe banke Melli: " ,scanf("%s",&Accountnumber);
cout<<"\n noe estekhdam ra entekhab konid: " ;
cout<<"\n 1] rasmi " ;
cout<<"\n 2] peyman " ;
cout<<"\n : " ;
cin>>typeemploy;
switch(typeemploy){
case 1:
strcpy(employmentType,"rasmi");
break;
case 2:
strcpy(employmentType,"peymani");
break;
case 3:
strcpy(employmentType,"");
break;
}
cout<<"\n semate karmand ra entekhab konid: " ;
cout<<"\n 1] modire kol " ;
cout<<"\n 2] moaven " ;
cout<<"\n 3] modire bakhsh " ;
cout<<"\n 4] karmande bakhsh " ;
cout<<"\n 5] abdarchi " ;
cout<<"\n 6] bazaryab "
<<"\n : ";
cin>>post;
switch(post){
case 1:
strcpy(Post,"modire kol");
BasicEarning=13468900;
break;
case 2:
strcpy(Post,"moaven");
BasicEarning=12456340;
break;
case 3:
strcpy(Post,"modire bakhsh");
BasicEarning=9893000;
break;
case 4:
strcpy(Post,"karmande bakhsh");
BasicEarning=9000000;
break;
case 5:
strcpy(Post,"abdarchi");
BasicEarning=6478800;
break;
case 6:
strcpy(Post,"bazaryab");
BasicEarning=7000000;
break;
}
cout<<"\n ozve sandooghe Refah:" ;
cout<<"\n 1] hast " ;
cout<<"\n 2] nist "
<<"\n : ";
cin>>refah;
switch(refah){
case 1:
joinRefah=1;
break;
case 2:
joinRefah=0;
break;
}
}
void Employee::changeinfo(Employee &e){
system("cls");
cout<<"\n\t***************************************************"
<<"\n\t\t samane sabtename persone"<<endl;
int post,typeemploy,refah;
cout<<"\n etela'ate zir ra vared konid: "<<endl ;
cout<<"\n naam va nameKhanevadegi: " ,scanf("%s",&Name) ;
cout<<"\n shomare shenasnameh: " ,scanf("%s",&IDNumber) ;
cout<<"\n adrese mahale sokounat: " ,scanf("%s",&HAddress) ;
cout<<"\n shomare mobile: " ,scanf("%s",&cellphone) ;
cout<<"\n tarikhe estekhdam: " ,scanf("%s",&employment);
cout<<"\n shomare hesabe banke Melli: " ,scanf("%s",&Accountnumber);
cout<<"\n noe estekhdam ra entekhab konid: " ;
cout<<"\n 1] rasmi " ;
cout<<"\n 2] peyman " ;
cout<<"\n : " ;
cin>>typeemploy;
switch(typeemploy){
case 1:
strcpy(employmentType,"rasmi");
break;
case 2:
strcpy(employmentType,"peymani");
break;
case 3:
strcpy(employmentType,"");
break;
}
cout<<"\n semate karmand ra entekhab konid: " ;
cout<<"\n 1] modire kol " ;
cout<<"\n 2] moaven " ;
cout<<"\n 3] modire bakhsh " ;
cout<<"\n 4] karmande bakhsh " ;
cout<<"\n 5] abdarchi " ;
cout<<"\n 6] bazaryab "
<<"\n : ";
cin>>post;
switch(post){
case 1:
strcpy(Post,"modire kol");
BasicEarning=13468900;
break;
case 2:
strcpy(Post,"moaven");
BasicEarning=12456340;
break;
case 3:
strcpy(Post,"modire bakhsh");
BasicEarning=9893000;
break;
case 4:
strcpy(Post,"karmande bakhsh");
BasicEarning=9000000;
break;
case 5:
strcpy(Post,"abdarchi");
BasicEarning=6478800;
break;
case 6:
strcpy(Post,"bazaryab");
BasicEarning=7000000;
break;
}
cout<<"\n ozve sandooghe Refah:" ;
cout<<"\n 1] hast " ;
cout<<"\n 2] nist "
<<"\n : ";
cin>>refah;
switch(refah){
case 1:
joinRefah=1;
break;
case 2:
joinRefah=0;
break;
}
}
//************************************************************** class PERSONNEL ****************************
class Personnel{
friend class Employee;
public:
void grantingLeave (Employee&);
void appointment (Employee&);
void promotion (Employee&);
void Report_of_personel(Employee&);
void Retirement (Employee&);
void Redemption (Employee&);
void Overtime (Employee&);
void Absence (Employee&);
};
void Personnel::grantingLeave (Employee &e){
int post;
cout<<"\n\t\t\t sodoore morakhasi";
cout<<"\n injaneb "<<e.Name<<endl;
cout<<" az saate \t ruz \t ela saate \t ruze \t\n khastar morakhasye bedoone hoghoogh mibasham.\n emza karmand *\t\t emza kargozini*";
}
void Personnel::appointment (Employee &e){
int post;
cout<<" \n poste feli "<<e.Name<<", "<<e.Post<<" mibashad.";
cout<<"\n be che semati mansoob shavand:";
cout<<"\n 1] modire kol " ;
cout<<"\n 2] moaven " ;
cout<<"\n 3] modire bakhsh " ;
cout<<"\n 4] karmande bakhsh " ;
cout<<"\n 5] abdarchi " ;
cout<<"\n 6] bazaryab "
<<"\n : ";
cin>>post;
switch(post){
case 1:
strcpy(e.Post,"modire kol");
break;
case 2:
strcpy(e.Post,"moaven");
break;
case 3:
strcpy(e.Post,"modire bakhsh");
break;
case 4:
strcpy(e.Post,"karmande bakhsh");
break;
case 5:
strcpy(e.Post,"abdarchi");
break;
case 6:
strcpy(e.Post,"bazaryab");
break;
}
cout<<"\n mansoob shodand.";
}
void Personnel::promotion (Employee &e){
int post;
cout<<" \n poste feli "<<e.Name<<", "<<e.Post<<" mibashad.";
cout<<"\n be che semati ertegha yaband:";
cout<<"\n 1] modire kol " ;
cout<<"\n 2] moaven " ;
cout<<"\n 3] modire bakhsh " ;
cout<<"\n 4] karmande bakhsh " ;
cout<<"\n 5] abdarchi " ;
cout<<"\n 6] bazaryab "
<<"\n : ";
cin>>post;
switch(post){
case 1:
strcpy(e.Post,"modire kol");
break;
case 2:
strcpy(e.Post,"moaven");
break;
case 3:
strcpy(e.Post,"modire bakhsh");
break;
case 4:
strcpy(e.Post,"karmande bakhsh");
break;
case 5:
strcpy(e.Post,"abdarchi");
break;
case 6:
strcpy(e.Post,"bazaryab");
break;
}
cout<<"\n ertegha dade shod.";
}
void Personnel::Report_of_personel(Employee &e){
cout<<endl;
cout<<" Shomare personeli : "<<e.Number <<endl;
cout<<" Naam : "<<e.Name <<endl;
cout<<" shomareShenasnameh : "<<e.IDNumber <<endl;
cout<<" adrese mahale sokounat: "<<e.HAddress <<endl;
cout<<" shomare mobile : "<<e.cellphone <<endl;
cout<<" tarikhe estekhdam : "<<e.employment <<endl;
cout<<" noe estekhdam : "<<e.employmentType <<endl;
cout<<" semate karmand : "<<e.Post <<endl;
cout<<" hoghogh payeh : "<<e.BasicEarning <<" Rial"<<endl;
cout<<" ozve sandooghe Refah : "<<e.joinRefah <<endl;
}
void Personnel::Overtime (Employee &e){
int plus;
cout<<"\n be ezaye har saat ezafe kari mablaghe 10.000 Rial be hoghooghe daryafti\n ezafe khahad shod."<<endl;
cout<<"\n saate ezafe kari ra vared konid: ",cin>>temp;
temp=temp*10000;
e.pl=e.pl+temp;
cout<<" haghe ezafe kari be hesabe agha/khanom "<<e.Name<<" manzoor shod"<<endl
<<" majmooe kole hoghooghe ezafe kari "<<e.pl<<" mibashad"<<endl;
}
void Personnel::Redemption (Employee &e){
cout<<"\n aghaye/khanome "<<e.Name<<" ba hoghooghe paye "<<e.BasicEarning<< "be mablaghe 210,000,000Rial\n bazkharid shodand.\n\t emza karmand\t\t emza modir."<<endl;
}
void Personnel::Retirement (Employee &e){
cout<<"\n aghaye/khanome "<<e.Name<<" ba hoghooghe paye "<<e.BasicEarning<< "az in tarikh be bad bazneshaste shode \n va mahane hoghooghi barabare 5600000Rial \n daryaft khahand kard.\n\t emza karmand\t\t emza modir."<<endl;
}
void Personnel::Absence (Employee &e){
cout<<"\n be ezaye har saat ghaybat mablaghe 10.000Rial az hoghooghe daryafti\n kam khahad shod."<<endl;
cout<<" saate ghaybat ra vared konid: ",cin>>temp;
temp=temp*10000;
e.mi=e.mi+temp;
cout<<" haghe ezafe kari be hesabe agha/khanom "<<e.Name<<" manzoor shod"<<endl
<<" majmooe kole kosoorat gheybat "<<e.mi<< "mibashad"<<endl;
}
//**************************************************************class FINANCE****************************
class Finance{
friend class Employee;
friend class Personnel;
public:
void c_salaries (Employee&);
void showPayStubs (Employee&);
void reportBAccNum (Employee&);
void reportPaySalaries (Employee&);
void reportRefah (Employee&);
};
void Finance::c_salaries (Employee &e){
cout<<" Aghaye/Khanome "<<e.Name<<endl
<<"\n tedade saate ezafe kari : "<<e.pl/10000
<<"\n haghe ezafe kari : "<<e.pl
<<"\n tedade saate gheybate : "<<e.mi/10000
<<"\n mablaghe kasr shode gheybatha: "<<e.mi<<endl;
temp=(e.BasicEarning)+(e.pl)-(e.mi);
cout<<"\n hoghooghe khalese daryafti shoma "<<temp<< " Rial mibashad.";
temp=0;
}
void Finance::showPayStubs (Employee &e){
temp=(e.BasicEarning)+(e.pl)+(e.mi);
cout<<" Aghaye/Khanome "<<e.Name<<endl
<<"\n hoghooghe daryafti in mahe shoma "<<temp<< " Rial mibashad."
<<"\n\t emzaye karamand\t\t emzaye raise omur mali";
}
void Finance::reportBAccNum (Employee &e){
cout<<" aghaye/khnome "<<e.Name<<" shomare hesabe: "<<e.Accountnumber<<endl;
}
void Finance::reportPaySalaries (Employee &e){
temp=(e.BasicEarning)+(e.pl)-(e.mi);
cout<<" aghaye/khnome "<<e.Name<<" hoghooghe pardakhti "<<temp<<endl;
}
void Finance::reportRefah (Employee &e){
if(e.joinRefah==1)
cout<<"\t"<<e.Name<<endl;
}
//*************************************************** MAIN **********************************************
void main(){
Employee* e[1000];
Personnel p;
Finance f;
cout<<"\n\n\n\n\n\n\n\n"
<<"\n*******************************************************************************"
<<"\n-------------------------------------------------------------------------------"
<<"\n Be barnameh sadeh personeli khosh amadid"
<<"\n-------------------------------------------------------------------------------"
<<"\n*******************************************************************************";
getch();
while(1)
switch1(e,p,f);
system("pause");
}
//*******************************************************************************************************
void set (Employee *e[]){
char ans;
do{
e[n]=new Employee;
e[n]->setinfo();
n++;
cout<<" Forme jadid?(y/n): ",cin>>ans;
}while (ans=='y');
}
void change (Employee *e[]){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh taghire moshakhasate personel";
cout<<"\n esme karmand morede nazar ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
e[i]->changeinfo(*e[i]);
else
cout<<"\n payda nashod";
getch();
}
void showall (Employee* e[],Personnel &p){
int i;
system("cls");
cout<<"\n\t*************************************************************";
cout<<"\n\t samaneh gozaresh giri az etelaate personel";
cout<<"\n baraye shorooe gozaresh giri kelidi ra feshar dahid..."<<endl, getch();
for (i=0;i<n;i++){
p.Report_of_personel(*e[i]);
cout<<"\t -------------------------------------------";
}
cout<<"\n tedade kole personel : "<<n<<endl,getch();
}
void switch1 (Employee* e[],Personnel &p,Finance &f){
int x;
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t Fehreste Aasli"<<endl;
cout<<"\n\t 1) Omur Karmandi";
cout<<"\n\t 2) kargozini";
cout<<"\n\t 3) omour mali"
<<"\n\t :";
cin>>x;
switch(x){
case 1:
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t Omur Karmandi";
cout<<"\n\t 1 ) sabtename karmande jadid";
cout<<"\n\t 2 ) taghir moshakhasate ";
cout<<"\n\t 3 ) <--"
<<"\n\t : ";
cin>>x;
switch(x){
case 1:
set (e);
break;
case 2:
change (e);
break;
case 3:
switch1 (e,p,f);
break;
}
break;
case 2:
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t Kargozini";
cout<<"\n\t 1 ) gozaresh giri az etelaate personel";
cout<<"\n\t 2 ) sodour morakhasi";
cout<<"\n\t 3 ) ezafe kari";
cout<<"\n\t 4 ) gheybat";
cout<<"\n\t 5 ) entesabe magham";
cout<<"\n\t 6 ) tafii magham";
cout<<"\n\t 7 ) bazneshastegi";
cout<<"\n\t 8 ) bazkharid";
cout<<"\n\t 9 ) ekhraje personel"
<<"\n\t 10) <-- "
<<"\n\t :";
cin>>x;
switch(x){
case 1:
showall (e,p);
break;
case 2:
morakhasi (e,p);
break;
case 3:
ezafe (e,p);
break;
case 4:
gheybat (e,p);
break;
case 5:
entesabe (e,p);
break;
case 6:
tarfii (e,p);
break;
case 7:
bazneshastegi (e,p);
break;
case 8:
bazkharid (e,p);
break;
case 9:
ekhraje (e,p);
break;
case 10:
switch1 (e,p,f);
break;
}
break;
case 3:
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t Omour Mali"<<endl
<<"\n\t 1) mohasebe hoghoogh"
<<"\n\t 2) sodour fish hoghooghi"
<<"\n\t 3) gozarsh giri az Shomare hesabhaye personel"
<<"\n\t 4) gozarsh giri az hoghooghe pardakhti"
<<"\n\t 5) gozarsh giri az azaye sandooghe refah"
<<"\n\t 6) <--"
<<"\n\t :";
cin>>x;
switch(x){
case 1:
hoghoogh (e,f);
break;
case 2:
fish (e,f);
break;
case 3:
gozarshShH (e,f);
break;
case 4:
pardakhti (e,f);
break;
case 5:
azayerefah (e,f);
break;
case 6:
switch1 (e,p,f);
break;
}
break;
}
}
void morakhasi (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh sodure morakhasi"<<endl;
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
p.grantingLeave(*e[i]);
else
cout<<"\n payda nashod";
getch();
}
void ezafe (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh gozaresh ezafekari personel";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
p.Overtime(*e[i]);
else
cout<<"payda nashod"<<endl;
getch();
}
void gheybat (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh gozaresh gheybate personel";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
p.Absence(*e[i]);
else
cout<<"\n payda nashod";
getch();
}
void entesabe (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh entesabe magham";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
p.appointment(*e[i]);
else
cout<<"\n payda nashod";
getch();
}
void tarfii (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh tarfie magham";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0)
p.grantingLeave(*e[i]);
else
cout<<"\n payda nashod";
getch();
}
void bazneshastegi (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh bazneshastegi";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0){
p.Retirement(*e[i]);
delete e[i];
}
else
cout<<"\n payda nashod"<<endl;
getch();
}
void bazkharid (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh bazkharid personel";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0){
p.Redemption(*e[i]);
delete e[i];
}
else
cout<<"\n payda nashod."<<endl;
getch();
}
void ekhraje (Employee* e[],Personnel &p){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh ekhraje personel";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0){
delete e[i];
}
else
cout<<"\n payda nashod"<<endl;
cout<<" hazfe etelaat ba movafaghiat anjam shod";
getch();
}
void hoghoogh (Employee* e[],Finance &f){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh mohasebe hoghoogh";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0){
f.c_salaries(*e[i]);
}
else
cout<<"\n payda nashod."<<endl;
getch();
}
void fish (Employee* e[],Finance &f){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh sodoore fidhe hoghooghi";
cout<<"\n esme karmand ra vared konid: ",scanf("%s",&name);
cout<<endl;
for (int i=0;i<n;i++)
if (strcmp(e[i]->Name,name)==0){
f.showPayStubs(*e[i]);
}
else
cout<<"\n payda nashod."<<endl;
getch();
}
void gozarshShH (Employee* e[],Finance &f){
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh gozaresh giri az shomare hesabe personel"<<endl;
for (int i=0;i<n;i++)
f.reportBAccNum(*e[i]);
getch();
}
void pardakhti (Employee* e[],Finance &f){
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh bazkharid personel"<<endl;
for (int i=0;i<n;i++)
f.reportPaySalaries(*e[i]);
getch();
}
void azayerefah (Employee* e[],Finance &f){
char name[51];
system("cls");
cout<<"\n\t***************************************************";
cout<<"\n\t\t samaneh gozaresh giri az afrade ozve sandooghe refah"<<endl;
cout<<"\n azaye sandoogh refah:\n"<<endl;
for (int i=0;i<n;i++)
f.reportRefah(*e[i]);
getch();
}