C++
C++ Project on LIC Database Management
LIC Database Management
Developed By: Saurabh Khatri & Nikhil Jha Class: XI C School: Greenway Modern Sr. Sec. School, Dilshad Garden, Delhi-95 Email: sk21393@gmail.com, jha.smartnicks.nikhil@gmail.com
//////*******************************************************\\\\\\
//////**** LIC DATABASE MANAGEMENT SOFTWARE ****\\\\\\
//////*******************************************************\\\\\\
//////Developed By :- Saurabh Khatri & Nikhil Jha \\\\\\
////// XI C \\\\\\
////// Greenway Modern Sr. Sec. School \\\\\\
////// Dilshad Garden \\\\\\
////// Delhi-95 \\\\\\
//////e-mail:- sk21393@gmail.com \\\\\\
////// jha.smartnicks.nikhil@gmail.com \\\\\\
/* HEADER FILES */
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* 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);
welcome();
}
/* WELCOME SCREEN */
void welcome()
{
clrscr();
int x=80,y=49;
for(x;x > 0;x--)
cout<<" ";
cout<<" "<<endl;
for(x=80;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. sum assured : "<<pol.minsumass;
gotoxy(12,16);
cout<<"- Max. sum assured : ";
puts(pol.maxsumass);
gotoxy(12,18);
cout<<"- Mode of payment allowed : ";
puts(pol.modeall);
gotoxy(12,20);
cout<<"- Accident benefit : "<<pol.acci_ben<<"%";
gotoxy(12,22);
cout<<"- Critical illness rider : "<<pol.CI<<"%";
gotoxy(12,24);
cout<<"- Female lives : "<<pol.femliv<<" years less";
gotoxy(12,26);
cout<<"- Age proof : ";
puts(pol.agepro);
gotoxy(12,28);
cout<<"- Non-medical (general) : ";
puts(pol.nonmed_gen);
gotoxy(12,30);
cout<<"- Non-medical (special) : ";
puts(pol.nonmed_spe);
gotoxy(12,32);
cout<<"- Term rider option : ";
puts(pol.termrideroptn);
gotoxy(12,34);
cout<<"- Critical illness rider : ";
puts(pol.crtcalilnesridr);
gotoxy(20,38);
cout<<"N=NEW CUSTOMER B=BACK X=EXIT";
gotoxy(20,40);
cout<<"Please enter your choice : ";
in=getch();
switch(in)
{
case 'n':
case 'N':newcus(pol);
break;
case 'b':
case 'B':newpol();
break;
case 'x':
case 'X':exit(0);
}
}
/* NEW CUSTOMER DATA INPUT */
void newcus(poldet pol)
{
static int i=0;
int j,o;
clrscr();
gotoxy(25,3);
cout<<"CUSTOMER DETAILS";
gotoxy(25,4);
cout<<"$$$$$$$$$$$$$$$$";
gotoxy(12,6);
cout<<"- Name : ";
gotoxy(12,8);
cout<<"- Age : ";
gotoxy(12,10);
cout<<"- House No. : ";
gotoxy(12,12);
cout<<"- Area : ";
gotoxy(12,14);
cout<<"- City : ";
gotoxy(12,16);
cout<<"- State : ";
gotoxy(12,18);
cout<<"- Annual salary : ";
gotoxy(12,20);
cout<<"- Policy name : ";
puts(pol.nam);
gotoxy(12,22);
cout<<"- Sum assured : ";
gotoxy(12,24);
cout<<"- Policy term : ";
gotoxy(12,26);
cout<<"- Mode of payment : (H)Half-yearly (Y)Yearly (Q)Quarterly (M)Monthly";
gotoxy(12,28);
cout<<"- Customer code : ";
gotoxy(32,6);
gets(custm[i].nam);
y:gotoxy(32,8);
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<<" and "<<pol.maxagemat;
gotoxy(32,8);
for(o=0;o<4;o++)
cout<<" ";
goto y;
}
else
{
gotoxy(20,40);
for(o=0;o<45;o++)
cout<<" ";
}
gotoxy(43,10);
gets(custm[i].addcust.hno);
gotoxy(38,12);
gets(custm[i].addcust.area);
gotoxy(38,14);
gets(custm[i].addcust.city);
gotoxy(39,16);
gets(custm[i].addcust.stat);
gotoxy(43,18);
cin>>custm[i].sal; //is JEEVAN KISHORE
g:gotoxy(43,22);
for(j=0;j<20;j++)
cout<<" ";
gotoxy(43,22);
cin>>custm[i].polamt;
if(custm[i].polamt<pol.minsumass)
{
gotoxy(20,40);
cout<<"Sum assured must be at least "<<pol.minsumass;
goto g;
}
else
{
gotoxy(20,40);
for(o=0;o<45;o++)
cout<<" ";
}
h:gotoxy(43,24);
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<<" and "<<pol.maxpolt;
goto h;
}
else
{
gotoxy(20,40);
for(o=0;o<45;o++)
cout<<" ";
}
k:gotoxy(43,26);
custm[i].mod_pay=getch();
switch(custm[i].mod_pay)
{
case 'h':
case 'H':
case 'y':
case 'Y':
case 'q':
case 'Q':
case 'm':
case 'M':cout<<custm[i].mod_pay;
break;
default:goto k;
}
custm[i].code=fabs(100+(20*custm[i].age)-(80*i)); //create unique code
gotoxy(43,28);
cout<<custm[i].code;
strcpy(custm[i].polbt,pol.nam);
custm[i].prem=premcalc(custm[i],pol);
clrscr();
gotoxy(34,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 : ";
puts(custm[i].addcust.hno);
gotoxy(45,10);
cout<<", ";
puts(custm[i].addcust.area);
gotoxy(25,12);
puts(custm[i].addcust.city);
gotoxy(40,12);
cout<<", ";
puts(custm[i].addcust.stat);
gotoxy(25,14);
cout<<"- ANNUAL SALARY : "<<custm[i].sal;
gotoxy(25,16);
cout<<"- POLICY BOUGHT : ";
puts(custm[i].polbt);
gotoxy(25,18);
cout<<"- SUM ASSURED : "<<custm[i].polamt;
gotoxy(25,20);
cout<<"- POLICY TERM : "<<custm[i].polterm<<" years";
gotoxy(25,22);
cout<<"- MODE OF PAYMENT : "<<custm[i].mod_pay;
gotoxy(25,24);
cout<<"- PREMIUM : "<<custm[i].prem;
gotoxy(25,26);
cout<<"- CUSTOMER CODE : "<<custm[i].code;
i++;
gotoxy(20,30);
cout<<"N=NEW CUSTOMER B=BACK X=EXIT";
gotoxy(20,32);
cout<<"Please enter your choice : ";
char ch=getch();
switch(ch)
{
case 'n':
case 'N':newcus(pol);
break;
case 'b':
case 'B':newpol();
break;
case 'x':
case 'X':exit(0);
}
}
/* 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.minpolt+pol.maxpolt)/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 : ";
puts(custm[i].addcust.hno);
gotoxy(45,14);
cout<<", ";
puts(custm[i].addcust.area);
gotoxy(25,16);
puts(custm[i].addcust.city);
gotoxy(40,16);
cout<<", ";
puts(custm[i].addcust.stat);
gotoxy(25,18);
cout<<"- ANNUAL SALARY : "<<custm[i].sal;
gotoxy(25,20);
cout<<"- POLICY BOUGHT : ";
puts(custm[i].polbt);
gotoxy(25,22);
cout<<"- SUM ASSURED : "<<custm[i].polamt;
gotoxy(25,24);
cout<<"- POLICY TERM : "<<custm[i].polterm<<" years";
gotoxy(25,26);
cout<<"- MODE OF PAYMENT : "<<custm[i].mod_pay;
gotoxy(25,28);
cout<<"- PREMIUM : "<<custm[i].prem;
gotoxy(25,30);
cout<<"- CUSTOMER CODE : "<<custm[i].code;
}
}
if(flag==0)
{
gotoxy(25,10);
cout<<"NO SUCH CUSTOMER FOUND";
}
gotoxy(20,34);
cout<<"B=BACK X=EXIT";
gotoxy(20,36);
cout<<"Please enter your choice : ";
char ch=getch();
switch(ch)
{
case 'b':
case 'B':cusmen();
break;
case 'x':
case 'X':exit(0);
}
}
/* NEW AGENT DATA INPUT */
void newagn()
{
static int i=0;
int o;
clrscr();
gotoxy(25,3);
cout<<"AGENT DETAILS";
gotoxy(25,4);
cout<<"$$$$$$$$$$$$$";
gotoxy(12,6);
cout<<"- Name : ";
gotoxy(12,8);
cout<<"- Age : ";
gotoxy(12,10);
cout<<"- Area : ";
gotoxy(12,12);
cout<<"- House No. : ";
gotoxy(12,14);
cout<<"- Area : ";
gotoxy(12,16);
cout<<"- City : ";
gotoxy(12,18);
cout<<"- State : ";
gotoxy(12,20);
cout<<"- Salary : ";
gotoxy(12,22);
cout<<"- Policies sold : ";
gotoxy(12,24);
cout<<"- Agent code : ";
gotoxy(32,6);
gets(agnt[i].nam);
y:gotoxy(33,8);
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;
b:gotoxy(38,16);
gets(agnt[i].addagn.area);
if(strcmp(agnt[i].addagn.area,"\0")==0)
goto b;
c:gotoxy(38,18);
gets(agnt[i].addagn.city);
if(strcmp(agnt[i].addagn.city,"\0")==0)
goto c;
d:gotoxy(39,20);
gets(agnt[i].addagn.stat);
if(strcmp(agnt[i].addagn.stat,"\0")==0)
goto d;
gotoxy(36,22);
cin>>agnt[i].sal;
gotoxy(43,24);
cin>>agnt[i].polsld;
if((agnt[i].polsld)>0 && (agnt[i].polsld)<1000) //categorise the agent
strcpy(agnt[i].categ,"BRANCH MANAGER CLUB MEMBER");
else if((agnt[i].polsld)>999 && (agnt[i].polsld)<2000)
strcpy(agnt[i].categ,"DIVISIONAL MANAGER CLUB MEMBER");
else if((agnt[i].polsld)>1999 && (agnt[i].polsld)<3000)
strcpy(agnt[i].categ,"ZONAL MANAGER CLUB MEMBER");
else if((agnt[i].polsld)>2999)
strcpy(agnt[i].categ,"CHAIRMAN CLUB MEMBER");
agnt[i].code=fabs(100+(20*agnt[i].age)-(80*i)); //create unique code
clrscr();
gotoxy(34,3);
cout<<"Your details are : ";
gotoxy(25,6);
cout<<"- NAME : ";
puts(agnt[i].nam);
gotoxy(25,8);
cout<<"- AGE : "<<agnt[i].age;
gotoxy(25,10);
cout<<"- ADDRESS : ";
puts(agnt[i].addagn.hno);
gotoxy(45,10);
cout<<", ";
puts(agnt[i].addagn.area);
gotoxy(25,12);
puts(agnt[i].addagn.city);
gotoxy(40,12);
cout<<", ";
puts(agnt[i].addagn.stat);
gotoxy(25,14);
cout<<"- SALARY : "<<agnt[i].sal;
gotoxy(25,16);
cout<<"- POLICIES SOLD : "<<agnt[i].polsld;
gotoxy(25,18);
cout<<"- CATEGORY : ";
puts(agnt[i].categ);
gotoxy(25,20);
cout<<"- AGENT CODE : "<<agnt[i].code;
i++;
gotoxy(20,24);
cout<<"N=NEW AGENT B=BACK X=EXIT";
gotoxy(20,26);
cout<<"Please enter your choice : ";
char ch=getch();
switch(ch)
{
case 'n':
case 'N':newagn();
break;
case 'b':
case 'B':agnmen();
break;
case 'x':
case 'X':exit(0);
}
}
/* OLD AGENT DETAILS */
void oldagn()
{
int flag=0;
clrscr();
gotoxy(25,6);
cout<<"PLEASE ENTER AGENT CODE : ";
int pn;
cin>>pn;
for(int i=0;i<15;i++)
{
if(pn==agnt[i].code) //check agent code
{
flag=1;
gotoxy(25,9);
cout<<"- NAME : ";
cout<<agnt[i].nam;
gotoxy(25,11);
cout<<"- AGE : "<<agnt[i].age;
gotoxy(25,13);
cout<<"- ADDRESS : ";
puts(agnt[i].addagn.hno);
gotoxy(45,13);
cout<<", ";
puts(agnt[i].addagn.area);
gotoxy(25,15);
puts(agnt[i].addagn.city);
gotoxy(40,15);
cout<<", ";
puts(agnt[i].addagn.stat);
gotoxy(25,17);
cout<<"- SALARY : "<<agnt[i].sal;
gotoxy(25,19);
cout<<"- POLICIES SOLD : "<<agnt[i].polsld;
gotoxy(25,21);
cout<<"- CATEGORY : ";
puts(agnt[i].categ);
gotoxy(25,23);
cout<<"- AGENT CODE : "<<agnt[i].code;
}
}
if(flag==0)
{
gotoxy(25,10);
cout<<"NO SUCH AGENT FOUND";
}
gotoxy(20,27);
cout<<"B=BACK X=EXIT";
gotoxy(20,29);
cout<<"Please enter your choice : ";
char ch=getch();
switch(ch)
{
case 'b':
case 'B':agnmen();
break;
case 'x':
case 'X':exit(0);
}
}
/* AGENT MENU */
void agnmen()
{
char c;
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<<"AGENT MENU";
gotoxy(36,6);
cout<<"$$$$$$$$$$";
gotoxy(36,9);
cout<<"N=NEW AGENT";
gotoxy(36,11);
cout<<"O=OLD 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<20;y++)
{
gotoxy(80,y);
delay(5);
cout<<"";
}
gotoxy(30,21);
cout<<"Please enter your choice : ";
y:c=getch();
switch(c)
{
case 'n':
case 'N':newagn();
break;
case 'o':
case 'O':oldagn();
break;
case 't':
case 'T':tncagn();
break;
case 'b':
case 'B':mainmen();
break;
case 'x':
case 'X':feed();
break;
default:goto y;
}
}
/* TERMS & CONDITIONS FOR AGENTS */
void tncagn()
{
clrscr();
gotoxy(25,5);
cout<<"TERMS & CONDITIONS FOR AGENTS";
gotoxy(25,6);
cout<<"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$";
gotoxy(12,9);
cout<<"- Minimum age to become an agent : 18 years";
gotoxy(12,11);
cout<<"- Categories of agents :";
gotoxy(14,13);
cout<<"1. Branch Manager Club Member : 1 - 999 policies sold";
gotoxy(14,15);
cout<<"2. Divisional Manager Club Member: 1000 - 1999 policies sold";
gotoxy(14,17);
cout<<"3. Zonal Manager Club Member : 2000 - 2999 policies sold";
gotoxy(14,19);
cout<<"4. Chairman Club Member : 3000+ policies sold";
gotoxy(20,23);
cout<<"B=BACK X=EXIT";
gotoxy(20,25);
cout<<"Please enter your choice : ";
char ch=getch();
switch(ch)
{
case 'b':
case 'B':agnmen();
break;
case 'x':
case 'X':exit(0);
}
}
/* FEEDBACK FORM */
void feed()
{
clrscr();
gotoxy(25,3);
cout<<"FEEDBACK FORM";
gotoxy(25,4);
cout<<"$$$$$$$$$$$$$";
gotoxy(12,6);
cout<<"- Age : ";
gotoxy(12,8);
cout<<"- Gender : (M)Male (F)Female";
gotoxy(12,10);
cout<<"- Occupation : ";
gotoxy(12,12);
cout<<"- Income : ";
gotoxy(12,14);
cout<<"Please rate the following (E=Excellent, G=Good, A=Average, P=Poor) :";
gotoxy(14,16);
cout<<"1. Software interface : ";
gotoxy(14,18);
cout<<"2. Ease of use : ";
gotoxy(14,20);
cout<<"3. Policy information : ";
gotoxy(14,22);
cout<<"4. Agent information : ";
gotoxy(14,24);
cout<<"5. Customer information : ";
gotoxy(14,26);
cout<<"6. Overall performance : ";
gotoxy(14,28);
cout<<"7. Premium calculation : ";
gotoxy(14,30);
cout<<"8. Data management : ";
gotoxy(14,32);
cout<<"9. Error handling : ";
gotoxy(14,34);
cout<<"10. Help & support : ";
gotoxy(14,36);
cout<<"11. Speed & efficiency : ";
gotoxy(14,38);
cout<<"12. Would you recommend this? : ";
gotoxy(27,6);
cin>>fbk.age;
gotoxy(21,10);
b:fbk.gndr=getch();
switch(fbk.gndr)
{
case 'm':
case 'M':
case 'f':
case 'F':cout<<fbk.gndr;
break;
default:goto b;
}
gotoxy(27,12);
gets(fbk.occp);
gotoxy(22,14);
cin>>fbk.inc;
gotoxy(57,23);
fbk.a[0]=feedval();
gotoxy(49,25);
fbk.a[1]=feedval();
gotoxy(56,27);
fbk.a[2]=feedval();
gotoxy(55,29);
fbk.a[3]=feedval();
gotoxy(56,31);
fbk.a[4]=feedval();
gotoxy(66,33);
fbk.a[5]=feedval();
gotoxy(45,35);
fbk.a[6]=feedval();
gotoxy(45,37);
fbk.a[7]=feedval();
gotoxy(47,39);
fbk.a[8]=feedval();
gotoxy(42,41);
fbk.a[9]=feedval();
gotoxy(45,43);
fbk.a[10]=feedval();
gotoxy(42,45);
fbk.a[11]=feedval();
gotoxy(36,47);
for(int x=0;x<9;x++)
{
cout<<fbk.a[x]<<" ";
}
getch();
exit(0);
}
/* FEEDBACK VALIDATION */
char feedval()
{
char r;
a:r=getch();
switch(r)
{
case 'e':
case 'E':
case 'g':
case 'G':
case 'a':
case 'A':
case 'p':
case 'P':if(r > '0' && r < '8')
cout<<r;
break;
default:goto a;
}
return r;
}