forked from mr-sergi/Hacktoberfest-2021
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLic Database system
1339 lines (1141 loc) · 22.4 KB
/
Lic Database system
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
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* HEADER FILES */
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<dos.h>
#include<ctype.h>
#include<stdio.h>
#include<process.h>
#include<iomanip.h>
#include<math.h>
/* STRUCTURE DEFINITIONS */
struct address /* STRUCTURE FOR ADDRESS */
{
char hno[30];
char area[30];
char city[30];
char stat[30];
};
struct agn /* STRUCTURE FOR AGENT DETAILS */
{
int code;
char nam[80];
int age;
address addagn;
int polsld; //no. of policies sold
float sal; //salary
char categ[50]; //category
}agnt[15];
struct cust /* STRUCTURE FOR CUSTOMER DETAILS */
{
char nam[80];
int age;
address addcust;
char polbt[20]; //name of policy bought
float sal; //salary
int code;
float polamt;
int polterm;
char mod_pay;
float sa_pt_pa; //SA per thousand per annum
float prem; //premium
}custm[15];
struct fback /* STRUCTURE FOR FEEDBACK FORM */
{
int age;
char gndr; //gender
char occp[20]; //occupation
float inc; //income
char a[12]; //ratings
}fbk;
struct poldet /* STRUCTURE FOR POLICY T&C */
{
char nam[20];
int minagemat;
int maxagemat;
int maxmatage;
int minpolt;
int maxpolt;
float minsumass;
char maxsumass[10];
char modeall[25];
float acci_ben;
float CI;
int femliv;
char agepro[40];
char nonmed_gen[5];
char nonmed_spe[5];
char termrideroptn[4];
char crtcalilnesridr[4];
float sa_pt_patrm1_ag1;//SA per thousand per annum
float sa_pt_patrm1_ag2;
float sa_pt_patrm2_ag1;
float sa_pt_patrm2_ag2;
};
/* STORING POLICY DETAILS */
poldet endow={"ENDOWMENT POLICY",12,65,75,5,55,50000.00,"No Limit","All",1.00,
7.26,2,"Birth Certificate / Board Certificate","Yes","Yes",
"Yes","Yes",72.00,73.35,35.80,40.00};
poldet monbak={"MONEY BACK POLICY",13,50,70,20,55,50000.00,"No Limit","All",
2.00,6.57,2,"Birth Certificate / Board Certificate","Yes","Yes",
"Yes","Yes",65.35,53.45,71.85,61.55};
poldet jeevkish={"JEEVAN KISHORE",0,12,45,15,35,50000.00,"40 Lacs","All",1.50,
6.52,2,"Birth Certificate / Board Certificate","N.A.","N.A.",
"No","No",49.15,29.25,49.15,29.25};
poldet jeevannd={"JEEVAN ANAND",18,65,75,5,57,100000.00,"No Limit",
"All Except Single",1.5,6.45,2,"Birth Certificate / Board Certificate",
"Yes","Yes","No","Yes",50.95,39.05,155.75,86.25};
poldet jeevsurbh={"JEEVAN SURABHI",14,50,70,15,25,50000.00,"No Limit","All",
1.00,6.11,2,"Birth Certificate / Board Certificate","Yes",
"Yes","No","No",108.80,91.30,123.00,112.80};
/* FUNCTION PROTOTYPING */
/* FUNCTION FOR DISPLAYING MAIN MENU */
void welcome();//display welcome page
void mainmen();//display main menu
/* CUSTOMER FUNCTIONS */
void cusmen();//display customer menu
void newpol();//display new policies
void tnccus(poldet pol);//display details of policies
void newcus(poldet pol);//new customer data input
float premcalc(cust custm,poldet pol);//premium calculation
void oldcus();//display old customer's previous policy details
void feed();//display feedback form
char feedval();//input & test the ratings of feedback form
/* AGENT FUNCTIONS */
void agnmen();//display agent menu
void newagn();//new agent data input
void oldagn();//old agent details
void tncagn();//display terms & conditions for agents
/* MAIN FUNCTION */
void main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout<<setprecision(2);
textbackground(BLACK);
textcolor(CYAN+BLINK);
clrscr();
delay(1500);
gotoxy(25,20);
puts("LOADING");
delay(2000);
for(int i=0;i<11;i++)
{
textcolor(CYAN);
textbackground(BLACK);
clrscr();
gotoxy(25,20);
puts("LOADING");
gotoxy(25,22);
for(int j=0;j<i;j++)
cout<<"ÛÛ";
for(int x=10-(i);x>0;x--)
cout<<" ";
cout<<" "<<i<<"0%";
if(i%2==0)
delay(500);
else
delay(200);
}
gotoxy(33,25);
puts("COMPLETE!!");
delay(500);
welcome();
}
/* WELCOME SCREEN */
void welcome()
{
clrscr();
for(int x=0;x<80;x++)
{
gotoxy(x,0);
cout<<"";
delay(5);
}
for(int y=0;y<48;y++)
{
gotoxy(0,y);
cout<<"\n";
delay(5);
}
for(x=79;x>0;x--)
{
gotoxy(x,49);
cout<<"";
delay(5);
}
gotoxy(80,49);
cout<<"";
for(y;y>0;y--)
{
gotoxy(80,y);
cout<<"\n";
delay(5);
}
gotoxy(10,10);
puts("*********************** W E L C O M E *********************** ");
gotoxy(18,16);
puts("L . I . C . D A T A B A S E S O F T W A R E");
gotoxy(38,22);
puts(" D E V E L O P E D B Y : ");
gotoxy(38,26);
puts(" Saurabh Khatri & Nikhil Jha ");
gotoxy(38,28);
puts(" XI C");
gotoxy(38,30);
puts(" Greenway Modern Sr.Sec. School");
gotoxy(38,32);
puts(" Dilshad Garden");
gotoxy(38,34);
puts(" DELHI-95");
gotoxy(38,40);
puts(" *** PRESS ANY KEY TO CONTINUE ***");
getch();
mainmen();
}
/* MAIN MENU */
void mainmen()
{
char a;
clrscr();
cout<<"\n";
for(int x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(int y=1;y<16;y++)
{
delay(5);
gotoxy(0,y);
cout<<"\n";
}
gotoxy(25,5);
cout<<"WELCOME TO LIFE INSURANCE COMPANY";
gotoxy(25,6);
cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$";
gotoxy(36,9);
cout<<"L.I.C. MENU";
gotoxy(36,12);
cout<<"C=CUSTOMER";
gotoxy(36,14);
cout<<"A=AGENT";
gotoxy(36,16);
cout<<"X=EXIT";
cout<<"\n\n";
for(x=1;x<80;x++)
{
delay(5);
cout<<"";
}
for(y=2;y<19;y++)
{
delay(5);
gotoxy(80,y);
cout<<"";
}
gotoxy(30,20);
cout<<"Please enter your choice : ";
x:a=getch();
switch(a)
{
case 'c':
case 'C':cusmen();
break;
case 'a':
case 'A':agnmen();
break;
case 'x':
case 'X':feed();
break;
default:goto x;
}
}
/* CUSTOMER MENU */
void cusmen()
{
char b;
x:clrscr();
cout<<"\n";
for(int x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(int y=1;y<16;y++)
{
delay(5);
gotoxy(0,y);
cout<<"\n";
}
gotoxy(36,5);
cout<<"CUSTOMER MENU";
gotoxy(36,6);
cout<<"$$$$$$$$$$$$$";
gotoxy(36,9);
cout<<"O=OLD CUSTOMER";
gotoxy(36,11);
cout<<"P=POLICIES";
gotoxy(36,13);
cout<<"B=BACK";
gotoxy(36,15);
cout<<"X=EXIT";
cout<<"\n\n";
for(x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(y=2;y<18;y++)
{
gotoxy(80,y);
delay(5);
cout<<"";
}
gotoxy(30,19);
cout<<"Please enter your choice : ";
y:b=getch();
switch(b)
{
case 'o':
case 'O':oldcus();
break;
case 'p':
case 'P':newpol();
break;
case 'b':
case 'B':mainmen();
break;
case 'x':
case 'X':feed();
break;
default:goto y;
}
}
/* NEW POLICY */
void newpol()
{
char inp;
clrscr();
cout<<"\n";
for(int x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(int y=1;y<17;y++)
{
delay(5);
gotoxy(0,y);
cout<<"\n";
}
gotoxy(30,5);
cout<<"LIFE INSURANCE POLICIES";
gotoxy(30,6);
cout<<"$$$$$$$$$$$$$$$$$$$$$$$";
gotoxy(31,9);
cout<<"1. Endowment Policy";
gotoxy(31,11);
cout<<"2. Money Back Policy";
gotoxy(31,13);
cout<<"3. Jeevan Kishore";
gotoxy(31,15);
cout<<"4. Jeevan Anand";
gotoxy(31,17);
cout<<"5. Jeevan Surabhi";
cout<<"\n\n";
for(x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(y=2;y<19;y++)
{
delay(5);
gotoxy(80,y);
cout<<"";
}
gotoxy(31,21);
cout<<"B=Back";
gotoxy(31,23);
cout<<"X=Exit";
gotoxy(31,25);
cout<<"Please enter your choice : ";
x:inp=getch();
switch(inp)
{
case '1':tnccus(endow);
case '2':tnccus(monbak);
case '3':tnccus(jeevkish);
case '4':tnccus(jeevannd);
case '5':tnccus(jeevsurbh);
case 'b':
case 'B':cusmen();
case 'x':
case 'X':exit(0);
default:goto x;
}
}
/* POLICY DETAILS */
void tnccus(poldet pol)
{
char in;
clrscr();
cout<<"\n";
for(int x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(int y=1;y<32;y++)
{
delay(5);
gotoxy(0,y);
cout<<"\n";
}
gotoxy(25,5);
cout<<"TERMS & CONDITIONS FOR ";
puts(pol.nam);
gotoxy(12,8);
cout<<"¯ Min./Max. age at entry : ";
cout<<pol.minagemat<<" / "<<pol.maxagemat;
gotoxy(12,10);
cout<<"¯ Max. maturity age : "<<pol.maxmatage;
gotoxy(12,12);
cout<<"¯ Min./Max. policy term : "<<pol.minpolt<<" / "<<pol.maxpolt;
gotoxy(12,14);
cout<<"¯ Min./Max. sum assured : "<<pol.minsumass<<" / ";
puts(pol.maxsumass);
gotoxy(12,16);
cout<<"¯ Mode allowed : ";
puts(pol.modeall);
gotoxy(12,18);
cout<<"¯ Accident Benefit : "<<pol.acci_ben;
cout<<" per thousand S.A. per annum";
gotoxy(12,20);
cout<<"¯ Compound Interest : "<<pol.CI;
gotoxy(12,22);
cout<<"¯ Female Lives : "<<pol.femliv;
gotoxy(12,24);
cout<<"¯ Age Proof : ";
puts(pol.agepro);
gotoxy(12,26);
cout<<"¯ Non Medical (General) : ";
puts(pol.nonmed_gen);
gotoxy(12,28);
cout<<"¯ Non Medical (Special) : ";
puts(pol.nonmed_spe);
gotoxy(12,30);
cout<<"¯ Term rider option : ";
puts(pol.termrideroptn);
gotoxy(12,32);
cout<<"¯ Critical illness rider : ";
puts(pol.crtcalilnesridr);
cout<<"\n";
for(x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(y=2;y<34;y++)
{
delay(5);
gotoxy(80,y);
cout<<"";
}
gotoxy(12,36);
cout<<"Does this policy satisfy your needs?(Y/N) : ";
a:in=getch();
switch(in)
{
case 'Y':
case 'y':newcus(pol);
case 'n':
case 'N':newpol();
default:goto a;
}
}
/* NEW POLICY FORM */
void newcus(poldet pol)
{
int j;
clrscr();
for(int i=0;i<15;i++)
{
if(strcmp(custm[i].nam,"\0")==0)
break;
}
gotoxy(28,3);
cout<<"POLICY FORM FOR ";
puts(pol.nam);
gotoxy(25,6);
cout<<"Please enter the following details : ";
gotoxy(25,8);
cout<<"¯ NAME : ";
gotoxy(25,10);
cout<<"¯ AGE : ";
gotoxy(25,12);
cout<<"¯ ADDRESS : ";
gotoxy(29,14);
cout<<"* HOUSE NO. : ";
gotoxy(29,16);
cout<<"* AREA : ";
gotoxy(29,18);
cout<<"* CITY : ";
gotoxy(29,20);
cout<<"* STATE : ";
gotoxy(25,22);
if(strcmp(pol.nam,"JEEVAN KISHORE"))
cout<<"¯ SALARY : ";
gotoxy(25,24);
cout<<"¯ POLICY AMOUNT : ";
gotoxy(25,26);
cout<<"¯ MODE OF PAYMENT : ";
gotoxy(29,28);
cout<<"( Q=QUARTERLY, H=HALF YEARLY, Y=YEARLY)";
gotoxy(25,30);
cout<<"¯ POLICY TERM : ";
a:gotoxy(34,8);
gets(custm[i].nam);
if(strcmp(custm[i].nam,"\0")==0)
goto a;
b:gotoxy(33,10);
for(j=0;j<20;j++)
cout<<" ";
gotoxy(33,10);
cin>>custm[i].age;
if(custm[i].age<pol .minagemat||custm[i].age>pol.maxagemat)
{
gotoxy(20,40);
cout<<"Age must be between "<<pol.minagemat<<" to "<<pol.maxagemat<<" years";
goto b;
}
else
{
gotoxy(20,40);
for(j=0;j<34;j++)
cout<<" ";
}
c:gotoxy(43,14);
gets(custm[i].addcust.hno);
if(strcmp(custm[i].addcust.hno,"\0")==0)
goto c;
d:gotoxy(38,16);
gets(custm[i].addcust.area);
if(strcmp(custm[i].addcust.area,"\0")==0)
goto d;
e:gotoxy(38,18);
gets(custm[i].addcust.city);
if(strcmp(custm[i].addcust.city,"\0")==0)
goto e;
f:gotoxy(39,20);
gets(custm[i].addcust.stat);
if(strcmp(custm[i].nam,"\0")==0)
goto f;
gotoxy(36,22);
if(strcmp(pol.nam,"JEEVAN KISHORE"))//check if the policy name
cin>>custm[i].sal; //is JEEVAN KISHORE
g:gotoxy(43,24);
for(j=0;j<20;j++)
cout<<" ";
gotoxy(43,24);
cin>>custm[i].polamt;
if(custm[i].polamt<pol.minsumass)
{
gotoxy(20,40);
cout<<"Policy amount must be more than Rs. "<<pol.minsumass;
goto g;
}
else
{
gotoxy(20,40);
for(j=0;j<50;j++)
cout<<" ";
}
gotoxy(45,26);
h:custm[i].mod_pay=getch();
switch(custm[i].mod_pay)
{
case 'q':
case 'Q':
case 'h':
case 'H':
case 'y':
case 'Y':custm[i].mod_pay=toupper(custm[i].mod_pay);
cout<<custm[i].mod_pay;
getch();
break;
default:goto h;
}
k:custm[i].polterm=0;
gotoxy(41,30);
for(j=0;j<15;j++)
cout<<" ";
gotoxy(41,30);
cin>>custm[i].polterm;
if((custm[i].polterm<pol.minpolt)||(custm[i].polterm>pol.maxpolt))
{
gotoxy(20,40);
cout<<"Policy term must be between "<<pol.minpolt;
cout<<" to "<<pol.maxpolt<<" years";
goto k;
}
else
{
gotoxy(20,40);
for(j=0;j<34;j++)
cout<<" ";
}
strcpy(custm[i].polbt,pol.nam);//copy the policy name to customer's details
custm[i].code=fabs((100*i)+89-(custm[i].age));//create unique code
custm[i].prem=premcalc(custm[i],pol);//calculate premium
clrscr();
gotoxy(30,3);
cout<<"Your details are : ";
gotoxy(25,6);
cout<<"¯ NAME : ";
puts(custm[i].nam);
gotoxy(25,8);
cout<<"¯ AGE : "<<custm[i].age;
gotoxy(25,10);
cout<<"¯ ADDRESS : ";
gotoxy(29,12);
cout<<"* HOUSE NO. : ";
puts(custm[i].addcust.hno);
gotoxy(29,14);
cout<<"* AREA : ";
puts(custm[i].addcust.area);
gotoxy(29,16);
cout<<"* CITY : ";
puts(custm[i].addcust.city);
gotoxy(29,18);
cout<<"* STATE : ";
puts(custm[i].addcust.stat);
gotoxy(25,20);
cout<<"¯ POLICY NAME : ";
puts(custm[i].polbt);
gotoxy(25,22);
if(strcmp(pol.nam,"JEEVAN KISHORE"))
cout<<"¯ SALARY : Rs. "<<custm[i].sal;
gotoxy(25,24);
cout<<"¯ POLICY AMOUNT : Rs. "<<custm[i].polamt;
gotoxy(25,26);
cout<<"¯ POLICY TERM : "<<custm[i].polterm<<" years";
gotoxy(25,28);
cout<<"¯ MODE OF PAYMENT : ";
switch(custm[i].mod_pay)
{
case 'Y':cout<<"YEARLY";
break;
case 'H':cout<<"HALF YEARLY";
break;
case 'Q':cout<<"QUARTERLY";
}
gotoxy(25,30);
cout<<"¯ PREMIUM : Rs. "<<custm[i].prem<<" per annum";
gotoxy(25,32);
cout<<"¯ CUSTOMER CODE : "<<custm[i].code;
getch();
cusmen();
}
/* PREMIUM CALCULATION */
float premcalc(cust custm,poldet pol)
{
float a;
if(custm.age<(pol.minagemat+pol.maxagemat)/2)
{
if(custm.polterm<=(pol.minpolt+pol.maxpolt)/2)
custm.sa_pt_pa=pol.sa_pt_patrm1_ag1;
if(custm.polterm>(pol.minagemat+pol.maxagemat)/2)
custm.sa_pt_pa=pol.sa_pt_patrm2_ag1;
}
if(custm.age>=(pol.minagemat+pol.maxagemat)/2)
{
if(custm.polterm<=(pol.minpolt+pol.maxpolt)/2)
custm.sa_pt_pa=pol.sa_pt_patrm1_ag2;
if(custm.polterm>(pol.minpolt+pol.maxpolt)/2)
custm.sa_pt_pa=pol.sa_pt_patrm2_ag2;
}
if(custm.mod_pay=='h'||custm.mod_pay=='H')
custm.sa_pt_pa*=0.985;
else if(custm.mod_pay=='y'||custm.mod_pay=='Y')
custm.sa_pt_pa*=0.97;
if(custm.polamt>pol.minsumass&&custm.polamt<=(2*pol.minsumass))
custm.sa_pt_pa-=1;
if(custm.polamt>(2*pol.minsumass))
custm.sa_pt_pa-=2;
a=(custm.sa_pt_pa)*(custm.polamt)/1000;
return a;
}
/* OLD CUSTOMER'S DETAILS */
void oldcus()
{
int flag=0;
clrscr();
gotoxy(25,6);
cout<<"PLEASE ENTER CUSTOMER CODE : ";
int pn;
cin>>pn;
for(int i=0;i<15;i++)
{
if(pn==custm[i].code)//check the customer code
{
flag=1;
gotoxy(25,10);
cout<<"¯ NAME : ";
puts(custm[i].nam);
gotoxy(25,12);
cout<<"¯ AGE : "<<custm[i].age;
gotoxy(25,14);
cout<<"¯ ADDRESS : ";
gotoxy(29,16);
cout<<"* HOUSE NO. : ";
puts(custm[i].addcust.hno);
gotoxy(29,18);
cout<<"* AREA : ";
puts(custm[i].addcust.area);
gotoxy(29,20);
cout<<"* CITY : ";
puts(custm[i].addcust.city);
gotoxy(29,22);
cout<<"* STATE : ";
puts(custm[i].addcust.stat);
gotoxy(25,24);
cout<<"¯ POLICY NAME : ";
puts(custm[i].polbt);
gotoxy(25,26);
cout<<"¯ SALARY : Rs. "<<custm[i].sal;
gotoxy(25,28);
cout<<"¯ POLICY AMOUNT : Rs. "<<custm[i].polamt;
gotoxy(25,30);
cout<<"¯ POLICY TERM : "<<custm[i].polterm<<" years";
gotoxy(25,32);
cout<<"¯ MODE OF PAYMENT : ";
switch(custm[i].mod_pay)
{
case 'Y':cout<<"YEARLY";
break;
case 'H':cout<<"HALF YEARLY";
break;
case 'Q':cout<<"QUARTERLY";
}
gotoxy(25,34);
cout<<"¯ PREMIUM : Rs. "<<custm[i].prem<<" per annum";
getch();
cusmen();
}
}
if(flag==0) //if customer is not found
{
gotoxy(25,8);
cout<<"SORRY, CUSTOMER NOT FOUND";
}
getch();
cusmen();
}
/* AGENT MENU */
void agnmen()
{
char b;
x:clrscr();
cout<<"\n";
for(int x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(int y=1;y<17;y++)
{
delay(5);
gotoxy(0,y);
cout<<"\n";
}
gotoxy(36,5);
cout<<"AGENT MENU";
gotoxy(36,6);
cout<<"$$$$$$$$$$";
gotoxy(36,9);
cout<<"O=OLD AGENT";
gotoxy(36,11);
cout<<"N=NEW AGENT";
gotoxy(36,13);
cout<<"T=TERMS & CONDITIONS";
gotoxy(36,15);
cout<<"B=BACK";
gotoxy(36,17);
cout<<"X=EXIT";
cout<<"\n\n";
for(x=0;x<80;x++)
{
delay(5);
cout<<"";
}
for(y=2;y<19;y++)
{
delay(5);
gotoxy(80,y);
cout<<"";
}
gotoxy(30,21);
cout<<"Please enter your choice : ";
y:b=getch();
switch(b)
{
case 'o':
case 'O':oldagn();
break;
case 'n':
case 'N':newagn();
break;
case 'T':
case 't':tncagn();
goto x;
case 'b':
case 'B':mainmen();
break;
case 'X':
case 'x':exit(0);
break;
default:goto y;
}
}
/* NEW AGENT FORM */
void newagn()
{
int o;
clrscr();
for(int i=0;i<15;i++)
{
if(strcmp(agnt[i].nam,"\0")==0)
break;
}
gotoxy(34,3);
cout<<"NEW AGENT FORM";
gotoxy(25,6);
cout<<"Please enter the following details : ";
gotoxy(25,8);
cout<<"¯ NAME : ";
gotoxy(25,10);
cout<<"¯ AGE : ";
gotoxy(25,12);
cout<<"¯ ADDRESS : ";
gotoxy(29,14);
cout<<"* HOUSE NO. : ";
gotoxy(29,16);
cout<<"* AREA : ";
gotoxy(29,18);
cout<<"* CITY : ";
gotoxy(29,20);
cout<<"* STATE : ";
gotoxy(25,22);
cout<<"¯ SALARY : ";
gotoxy(25,24);
cout<<"¯ POLICIES SOLD : ";
x:gotoxy(34,8);
gets(agnt[i].nam);
if(strcmp(agnt[i].nam,"\0")==0)
goto x;
y:gotoxy(33,10);
cin>>agnt[i].age;
if(agnt[i].age<18)
{
gotoxy(20,40);
cout<<"Age must be more than 18";
gotoxy(33,10);
for(o=0;o<4;o++)
cout<<" ";
goto y;
}
else
{
gotoxy(20,40);
for(o=0;o<35;o++)
cout<<" ";
}
a:gotoxy(43,14);
gets(agnt[i].addagn.hno);
if(strcmp(agnt[i].addagn.hno,"\0")==0)
goto a;