Beruflich Dokumente
Kultur Dokumente
BONAFIDE CERTIFICATE
ACKNOWLEDGEMENT
3
I have taken efforts in this project. However, it would not have been
possible without the kind support and help of many individuals and
organizations. I would like to extend my sincere thanks to all of them.
I am highly indebted to Tata Consultancy Services for their guidance
and constant supervision as well as for providing necessary
information regarding the project & also for their support in completing
the project.
I would like to express my gratitude towards my computer teachers for
their kind co-operation and encouragement which help me in
completion of this project.
I would like to express my special gratitude and thanks to Maharishi
Vidya Mandir Senior Secondary School for giving me such attention
and time.
My thanks and appreciations also go to my classmates in developing
the project and people who have willingly helped me out with their
abilities.
CONTENTS
4
1.
2.
3.
4.
5.
6.
7.
PROBLEM DEFINITION
PROBLEM ANALYSIS
HARDWARE AND SOFTWARE REQUIREMENTS
FUTURE ENHANCEMENTS
SOURCE CODE
OUTPUT
BIBILIOGRAPHY
Page
Page
Page
Page
Page
Page
Page
No.
No.
No.
No.
No.
No.
No.
6
7
8
9
10
36
41
PROBLEM DEFINITION
Notification
*Customer informs
agent of the loss details & agent provides the details of the nearest
vendor.
received,finalizes
which delays
Storing data
*Amount paid to
each claim, details about the claim & no. of claims handled by each claim
handler are stored for future taxing purposes.
*PROBLEMS
PROBLEM ANALYSIS
The Problem is divided into 4 different components.
1. Policy Schemes
Classes used :
Policy with policy number, coverage limit, policy name, vehicle and
validation period as its members.
Functions used:
2. Buying a policy
Classes used :
* Mif (member info. form) with member no., policy no., personal
address, additional address, occupation, phone no., additional phone
no., marital status & 3 objects of class dat as its members & input ( )
as its member function.
*mno (Member no.) with member no. as its member
Functions used:
warning( )
age( )
pdetail( )
file1( )
file2( )
file3( )
- writes the new member no. lastly used on a file.
Member functionsA.)mif::input( ) gets the input from the user for
Data members of the class mifs.
3. Claiming Insurance
Classes used :
* claim with member no., claim amount, place of loss, injury, fatality,
policy activeness and 2 objects of class dat as its members and input( )
as its member function.
*hand with claim handler number, name, handling cases and phone no.
as its members.
*in with vehicle model, damage 1, damage 2,damage 3, vehicle
registration no. and no. of months run as its members and input( ) as
its members.
Functions used:
claim( )
displays the insurance claim form
warning( ) displays a warning message in the claim
dam( )
no( )
hand( )
in( )
end( )
cfile( )
Valid( )
happened to vehicle.
Member functionsA.)claim::input( )
4. Reports
Classes used :
* report1 with member no., claim no., claimed amount and 2 objects of
class dat as its members.
Functions used:
report( )
trespass( )
report1( )
report2( )
erase( )
comp( )
count( )
fun( )
home( )
logo( )
ad( )
in the homepage.
C.)dat::check( )
D.)dat::tdate( )
10
FUTURE ENHANCEMENTS
11
SOURCE CODE
#include<fstream.h>
#include<process.h>
#include<string.h>
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<time.h>
#include<ctype.h>
///////////////////////////////////////////////////////////////////////////////////////////////////////
/*GLOBAL VARIABLES*/
long int p,lo,li,check,j=10000,kit=0,f=0,JK=0;
char op,kl[1]={15};
//////////////////////////////////////////////////////////////////////////////////////////////////////
/*FUNCTION DEFINITIONS IN ALPHABETICAL ORDER GROUPED BASED ON
RETURN TYPES */
void
void
void
void
void
void
void
void
age();
claim();
file1();
file4();
hand();
logo();
output();
report1();
void
void
void
void
12
void
void
void
void
void
void
void
void
ad();
void cfile();
dam();
void
end();
file2();
void file3();
file5();
void
fun();
home();
void input();
member();
void
no();
pdetail();
void policy();
report2();
void trespass();
}
for( i=y;i<51-y;i++)
{
//vertical lines
gotoxy(x,i); cout<<'.';
gotoxy(80-x,i); cout<<'.';
}
}
struct dat
{
int dd,mm,yyyy; char ch;
void input()
{
ch='/';
cin>>dd>>ch>>mm>>ch>>yyyy;
}
void display()
{
ch='/';
cout<<dd<<ch<<mm<<ch<<yyyy;
}
void tdate();
int check(int x,int y);
}s1,s2,s3,s4;
void dat::tdate ()
//provides the current date
{
long int op=86400,leap=0,lp=0;
//op- no. of seconds in a yr
time_t seconds;
char ch='/';
seconds = time (NULL);
yyyy=(seconds/op)/365; yyyy+=1970;
for(int i=1970;i<yyyy;i++)
{
if(i%4==0) {
if(i%400==0 || i%100!=0)
leap++;
13
}
}
if(i%4==0)
{
if(i%400==0 || i%100!=0) {
lp=1; leap++;
}
}
dd=( (seconds/op) % 365 ) - leap; dd++;
if(dd<=31 && dd>0) mm=1;
else if(dd<=59) {mm=2; dd-=31; }
else if(dd<=90) {mm=3; dd-=59; }
else if(dd<=120) {mm=4; dd-=90; }
else if(dd<=151) {mm=5; dd-=120;}
else if(dd<=181) {mm=6; dd-=151;}
else if(dd<=212) {mm=7; dd-=181;}
else if(dd<=243) {mm=8; dd-=212;}
else if(dd<=273) {mm=9; dd-=243;}
else if(dd<=304) {mm=10; dd-=273;}
else if(dd<=334) {mm=11; dd-=304;}
else if(dd<=365) {mm=12; dd-=334;}
dd+=lp;
cout<<dd<<ch<<mm<<ch<<yyyy;
}
int dat::check(int x,int y)
{
int k=0;
if(yyyy>2011 || yyyy<1921) k=1;
if(mm<1 || mm>12)
k=1;
if(dd>31 || dd<1)
k=1;
switch(mm)
{
case 2 : { if(yyyy%4==0) {
if(dd>29) k=1;
else
}
{
if(dd>28) k=1;
}
break;
}
case 4 :
case 6 :
case 9 :
case 11 : if(dd>30) k=1;
}
if(k==1) { gotoxy(x,y); cout<<"INVALID"; return 0; }
else
{
erase(x,y,7,' ');
return 1;}
}
14
15
///////////////////////////////////////////////////////////////////////////////////////////////////////
/*MAIN PAGE*/
void main()
{
clrscr();
char c;
layout(12,17);
gotoxy(28,20); textcolor(BLUE);
cprintf("CBSE COMPUTER SCIENCE PROJECT");
gotoxy(25,23); cout<<"PROJECT : AUTO INSURANCE CLAIMS ";
gotoxy(25,26); cout<<"DEVELOPED BY,";
gotoxy(39,28); cout<<"K.GIRIDHARAN";
gotoxy(25,32); textcolor(WHITE);
cprintf("ENTER E TO LOOK INTO THE PROJECT ...");
I: gotoxy(60,32); cin>>c;
if(c=='E') home(); else goto I;
getch();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
/*HOME PAGE*/
void home()
{
clrscr();
char ch;
ad();
logo();
layout(2,3);
input();
textcolor(CYAN); gotoxy(27,16);
cprintf("ABC INSURANCE COMPANY");
gotoxy(20,20); cout<<"TO KNOW ABOUT THE POLICY SCHEMES IN AVAIL
:PRESS P";
gotoxy(20,22); cout<<"BUY A POLICY?
:PRESS B";
gotoxy(20,24); cout<<"TO CLAIM INSURANCE
:PRESS C";
gotoxy(20,26); cout<<"PERFORMANCE REPORT
:PRESS R";
gotoxy(29,30); cprintf("ENTER YOUR NEED ...");
gotoxy(20,28); cout<<"TO LEAVE
:PRESS E";
A: gotoxy(46,30); cin>>ch;
switch(ch)
{
case 'P' : {policy( ); break;}
case 'B' : {member( ); break;}
case 'C' : {claim ( ); break;}
case 'R' : {report( ); break;}
case 'E' : exit (0);
default : {gotoxy(30,32); cout<<"ENTER AGAIN"; goto A;}
}
16
getch();
}
void logo()
{
for(int i=4;i<15;i++)
{
for(int j=25;j<54;j++)
{
if
(i<8)
textcolor(RED);
else if(i>7 && i<11)
textcolor(WHITE);
else
textcolor(BLUE);
gotoxy(j,i); cprintf("*");
}
cout<<endl;
}
//A
for(i=5;i<14;i++)
{
gotoxy(26,i); cout<<' ';
gotoxy(32,i); cout<<' ';
if(i<=11)
{
gotoxy(21+i,5); cout<<' ';
gotoxy(21+i,9); cout<<' ';
}
}
//B
for(i=5;i<14;i++)
{
gotoxy(36,i); cout<<' ';
gotoxy(42,i); cout<<' ';
if(i<=11)
{
gotoxy(31+i,5); cout<<' ';
gotoxy(31+i,13);cout<<' ';
gotoxy(31+i,9); cout<<' ';
}
}
//C
for(i=5;i<14;i++)
{
gotoxy(46,i); cout<<' ';
if(i<=11)
{
gotoxy(41+i,5); cout<<' ';
gotoxy(41+i,13); cout<<' ';
}
}
17
}
void ad()
{
for(int i=35;i<48;i++)
{
gotoxy(34,i); cout<<'.';
gotoxy(44,i); cout<<'.';
}
for(i=3;i<34;i++)
{
gotoxy(i,35); cout<<'.'; //2 STATEMENTS
}
for(i=44;i<=78;i++)
{
gotoxy(i,35); cout<<'.';
}
textcolor(LIGHTGREEN);gotoxy(8,37);
cprintf("ACHIEVEMENTS AND AWARDS");
gotoxy(4,39); cout<<"ABC INSURANCE CO. WAS AWARDED ";
gotoxy(6,41); cout<<"BEST AUTO INSURER 2010 ";
gotoxy(6,43); cout<<"AWAAZ CONSUMER AWARD 2009";
gotoxy(4,45); cout<<"PROFIT BUISNESSSHIP AWARD 2008";
textcolor(BLUE+BLINK); gotoxy(49,37);
cprintf("NEW! NEW! NEW! NEW! NEW!");
textcolor(RED); gotoxy(50,40);
cprintf(" ABC VERGO POLICY");
gotoxy(46,42); cout<<"VALIDITY PERIOD
: 5 YEARS";
gotoxy(46,44); cout<<"COVERAGE AMOUNT(max): $ 3000";
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
/*POLICY DETAILS
AVAILABLE IN ABC*/
struct policy
{
int pno,cv,ti;
char pname[25],veh[20];
}s[6];
void policy()
{
clrscr();
layout(2,3);
for(int i=6;i<48;i++)
{
gotoxy(26,i); cout<<'.';
gotoxy(52,i); cout<<'.';
18
}
for(i=2;i<=78;i++)
{
gotoxy(i,6); cout<<'.';
gotoxy(i,27); cout<<'.';
}
textcolor(BLUE); gotoxy(15,5);
cprintf("POLICY SCHEMES AVAILABLE IN ABC AUTO INSURANCE CO.");
input();
output();
gotoxy(15,50); cprintf("PRESS 1 TO RETURN TO HOME OR 2 TO
MEMBERSHIP FORM .....");
G: gotoxy(68,50); cin>>lo;
if
(lo==2) member();
else if(lo==1) home();
else goto G;
getch();
}
void input()
{
s[0].pno=23501; s[1].pno=23502; s[2].pno=23503; s[3].pno=23504;
s[4].pno=23505; s[5].pno=23506;
s[0].cv=1200; s[1].cv=1800; s[2].cv=2500; s[3].cv=3000;
s[4].cv=4000; s[5].cv=4500;
s[0].ti=2;
s[1].ti=2;
s[2].ti=3; ; s[3].ti=5;
s[4].ti=5;
s[5].ti=7;
strcpy(s[0].pname,"POLICY NUMBER 1"); strcpy(s[3].pname,"POLICY
NUMBER 4");
strcpy(s[1].pname,"POLICY NUMBER 2"); strcpy(s[4].pname,"POLICY
NUMBER 5");
strcpy(s[2].pname,"POLICY NUMBER 3"); strcpy(s[5].pname,"POLICY
NUMBER 6");
strcpy(s[0].veh,"CAR");
strcpy(s[1].veh,"3-WHEELER");
strcpy(s[2].veh,"BIKE");
strcpy(s[3].veh,"PERMIT LORRYS");
strcpy(s[4].veh,"TRAVEL BUSES");
strcpy(s[5].veh,"CABS");
}
void output()
{
gotoxy(6,8); cout<<s[0].pname;
gotoxy(6,29);
cout<<s[3].pname;
gotoxy(33,8); cout<<s[1].pname;
gotoxy(33,29);
cout<<s[4].pname;
gotoxy(58,8); cout<<s[2].pname;
gotoxy(58,29);
cout<<s[5].pname;
gotoxy(4,12); cout<<"PNO : "<<s[0].pno;
gotoxy(4,33); cout<<"PNO :
"<<s[3].pno;
gotoxy(30,12); cout<<"PNO : "<<s[1].pno; gotoxy(30,33); cout<<"PNO :
"<<s[4].pno;
19
20
clrscr();
layout(2,2);
gotoxy(15,3); cout<<"ABC AUTO INSURANCE MEMBER INFORMATION AND
SIGN UP FORM";
gotoxy(5,7); cout<<"TODAY'S DATE ..........";
textcolor(BLUE); gotoxy(9,5);
cprintf("ENTER 2 TO GET DETAIL ABOUT PNO ELSE PRESS 0 ... ");
gotoxy(10,9); cout<<"MEMBER NAME
: .................";
gotoxy(10,11); cout<<"PRIMARY ADDRESS
: ........................";
gotoxy(10,12); cout<<"
........................";
gotoxy(10,13); cout<<"NOMINEE NAME
: ..................";
gotoxy(10,15); cout<<"NOMINEE ADDRESS
: ........................";
gotoxy(10,16); cout<<"
: ........................";
gotoxy(10,17); cout<<"PHONE
NUMBER
: ..........";
gotoxy(10,19); cout<<"NOMINEE PHONE NUMBER : ..........";
gotoxy(10,21); cout<<"OCCUPATION
: ..........";
gotoxy(10,23); cout<<"POLICY OPTED(ENTER PNO): ..........";
gotoxy(10,25); cout<<"DATE OF BIRTH
: .dd/mm/yyyy.";
gotoxy(10,27); cout<<"MARITAL STATUS
:";
gotoxy(10,29); cout<<"PRESS S IF SINGLE ELSE PRESS M IF MARRIED";
gotoxy(20,31); cout<<"
....";
for(int i=3;i<=78;i++)
{
gotoxy(i,39); cout<<kl;
}
textcolor(RED+BLINK); gotoxy(35,41);
cprintf("WARNING!!!!!!");
textcolor(LIGHTRED); gotoxy(5,43);
cprintf("BE CAREFUL WHILE FILLING THE FORM. IF THE PROGRAM IS
MALFUNCTIONING");
gotoxy(5,44); cprintf("PRESS Z(CAPS) ANYWHERE TO RETURN TO HOME ");
gotoxy(5,46); cout<<"THE PROGRAM MIGHT MALFUNCTION IF U PROVIDE
WRONG INFO SUCH PROVIDING ";
gotoxy(5,47); cout<<"DIGITS FOR MEMBER NAME/OCCUPATION FIELDS.";
k.input();
getch();
}
int checknam(char j[25])
{ for(int i=0;j[i]!='\0';j++)
if(!isalpha(j[i]) && j[i]!='.') return 0;
return 1;
}
int mif:: input()
{
gotoxy(19,7); s1.tdate();
gotoxy(55,5); cin>>li;
s: gotoxy(35,9); gets(mname);
0; }
if(li==2) policy();
if(!strcmp("Z",mname)) {home(); return
21
if(!checknam(mname))
{ gotoxy(48,9); cout<<"INVALID NAME";
count(62,9,5); erase(35,9,13,'.');
goto s;}
else erase(48,9,12,' ');
gotoxy(35,11); gets(padd1); if(!strcmp("Z",padd1)) {home(); return 0; }
gotoxy(35,12); gets(padd2); if(!strcmp("Z",padd2)) {home(); return 0; }
q: gotoxy(35,13); gets(nname); if(!strcmp("Z",nname)) {home(); return
0; }
if(!checknam(nname))
{gotoxy(48,13); cout<<"INVALID NAME";
count(62,13,5); erase(35,13,13,'.');
goto q;}
else erase(48,13,12,' ');
Q: gotoxy(35,15); gets(aadd1); if(!strcmp("Z",aadd1)) {home(); return 0; }
gotoxy(35,16); gets(aadd2); if(!strcmp("Z",aadd2)) {home(); return
0; } // if(kit!=0) goto L;
d: gotoxy(35,17); gets(phno);
if(!strcmp("Z",phno)) {home(); return 0; }
if(!phcheck(phno))
{ gotoxy(48,17); cout<<"INVALID NUMBER";
count(64,17,5); erase(35,17,10,'.');
goto d;
}
else erase(48,17,15,' ');
F: gotoxy(35,19); gets(aphno); if(!strcmp("Z",aphno)) {home(); return 0; }
if(!phcheck(aphno))
{ gotoxy(48,19); cout<<"INVALID NUMBER";
count(64,19,5); erase(35,19,10,'.');
goto F;
}
else erase(48,19,15,' ');
if(kit!=0) goto Z;
gotoxy(35,21); gets(occ);
if(!strcmp("Z",occ)) {home(); return 0; }
y:
gotoxy(35,23); cin>>pno;
if(pno=='Z')
{home(); return 0; }
if(kit!=0) goto U;
B: gotoxy(36,25); s2.input();
if(s2.check(48,25)==0)
{ erase(36,25,10,'.'); goto B;}
else erase(48,25,7,' ');
if(s2.yyyy+18>s1.yyyy) { age(); return 0;}
else if(s2.yyyy+18==s1.yyyy)
{
if(s2.mm<s1.mm) {age(); return 0;}
else if(s2.mm+18==s1.mm){ if(s2.dd<=s2.dd) age(); return 0; }
}
if(s2.yyyy+80<s1.yyyy) {age(); return 0;}
tmif=s1; bmif=s2;
W:
gotoxy(38,31); cin>>mars;
22
strcpy(padd,strcat(padd1,padd2));
strcpy(aadd,strcat(aadd1,aadd2));
Z:
if(!strcmp(phno,aphno)) {gotoxy(46,19); cout<<"ENTER ANOTHER PHONE
NUMBER "; kit++; goto F; }
else erase(46,19,26,' ');
U:
if(pno>23506 || pno<23501)
{ gotoxy(41,23); cout<<"INVALID POLICY NUMBER";
kit++; count(71,23,4);
erase(35,23,6,'.'); goto y;
}
else erase(41,23,21,' ');
E:
switch(mars)
{
case 'S':{erase(26,32,22,' '); break;}
case 'M':{ erase(26,32,22,' '); break;}
default:{gotoxy(26,32); cout<<"INVALID MARITAL STATUS"; goto W;}
}
check=0;
file2();
mno=j;
file1();
gotoxy(20,35); cout<<"WELCOME "<<mname<<", YOUR MEMBER
NUMBER IS "<<mno;
pdetail();
file3();
return 7;
}
void file2()
{
ifstream ko;
ko.open("b7mno.dat",ios::binary);
if(!ko);
else ko.read((char *) &j,sizeof(j));
ko.close();
if(check==0)
{
j++;
ofstream kii;
kii.open("b7mno.dat",ios::binary );
kii.write((char *) &j,sizeof(j));
kii.close();
}
}
int phcheck(char s[13])
{ int f=strlen(s);
for(int h=0;s[h]!='\0';h++)
if(!isdigit(s[h]) && s[h]!='+') return 0;
if( ((f!=8) && f!=10)) return 0;
23
return 1;
}
void file1()
{
ofstream ki;
ki.open("b7memb.dat",ios::binary | ios::app);
ki.write((char *) &k,sizeof(k));
ki.close();
}
void age()
{
clrscr();
layout(7,20);
gotoxy(13,25); cout<<"SORRY MR."<<k.mname<<",YOUR ARE NOT
ABOVE 18 YEARS/TOO AGED. " ;
gotoxy(13,27); cout<<"YOU CANNOT BUY A POLICY.";
getch();
home();
}
void pdetail()
{
clrscr();
layout(15,17);
input();
int o=(k.pno%10)-1;
textcolor(YELLOW); gotoxy(30,10);
cprintf("YOUR POLICY DETAILS");
gotoxy(22,20); cout<<"MEMBER NUMBER
: "<<k.mno;
gotoxy(22,22); cout<<"POLICY NAME
: "<<s[o].pname;
gotoxy(22,24); cout<<"VEHICLE
: "<<s[o].veh;
gotoxy(22,26); cout<<"POLICY START DATE : "; s1.display();
gotoxy(22,28); cout<<"POLICY END DATE : ";
gotoxy(42,28);
k.pend.dd=s1.dd; k.pend.mm=s1.mm; k.pend.yyyy=s1.yyyy+s[o].ti;
k.pend.display();
gotoxy(22,30); cout<<"COVERAGE LIMIT : $"<<s[o].cv;
getch();
home();
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
/*INSURANCE
CLAIM*/
class in
{
24
char mod[20],dam1[30],dam2[30],dam3[30],regno[14];
int mon;
public:
void input();
}q;
class hand
{
public:
int no;
char name[50],typ[30],pno[10];
}x[3];
struct claim
{
long int mno,amnt;
char where[20],act,inj,fat;
dat r,t;
int input();
}v;
void claim()
{
clrscr();
int k;
layout(2,2);
textcolor(YELLOW); gotoxy(25,5);
cprintf("ABC AUTO INSURANCE CLAIM FORM");
gotoxy(6,8); cout<<"CLAIM DATE : ";
gotoxy(10,12); cout<<"MEMBER NUMBER
: ............";
gotoxy(10,14); cout<<"WHERE DID THE DAMAGE
HAPPEN ?
: ............";
gotoxy(10,16); cout<<"WHEN DID THE DAMAGE HAPPEN ?
:
.dd/mm/yyyy.";
gotoxy(10,18); cout<<"IS YOUR POLICY ACTIVE ?
(Y/N) : .....";
gotoxy(10,20); cout<<"ANY INJURY HAPPENED TO POLICY HOLDER ?(Y/N) :
.....";
gotoxy(10,22); cout<<"ANY FATALITY DURING THE DAMAGE ?
(Y/N) : .....";
gotoxy(10,24); cout<<"FILL THE AMOUNT REQUIRED TO CURE THE
DAMAGE : .$.......";
gotoxy(10,26); cout<<"VEHICLE DETAILS
: ............ ";
warning(3,3);
k=v.input();
if(!k) exit(0);
hand();
end();
getch();
}
void warning(int x,int h)
{
25
if(!strcmp("Z",where)) home();
if(comp(l.tmif,s3)==-1)
{
clrscr();
layout(4,17);
gotoxy(6,21); cout<<"SORRY MR "<<l.mname<<',';
gotoxy(26,23);cout<<"YOU CANNOT CLAIM INSURANCE FOR ACCIDENTS
";
gotoxy(26,25); cout<<"BEFORE SIGNING DATE";
getch();
return 0;
}
if(comp(l.pend,s3)==-1) no();
else {gotoxy(61,18); cout<<'Y'; }
26
if(valid()!=0)
{
clrscr();
layout(4,20);
gotoxy(6,22); cout<<"SORRY, YOU CANNOT CLAIM FOR THE SAME CAUSE
MORE THAN ONCE";
getch();
home();
return 0;
}
F: gotoxy(61,20); cin>>inj; if(inj=='Z') home(); if(kit!=0) goto O;
N: gotoxy(61,22); cin>>fat; if(fat=='Z') home(); if(kit!=0) goto P;
gotoxy(58,24); cin>>amnt;
O: switch(inj)
{
case 'Y': {erase(64,20,7,' '); break;}
case 'N': {erase(64,20,7,' '); break;}
default : {
gotoxy(64,20);
cout<<"INVALID";
kit++; goto F;
}
}
P: switch(fat)
{
case 'Y' : {erase(64,22,7,' '); break;}
case 'N' : {erase(64,22,7,' ');break;}
default : {
gotoxy(64,22);
cout<<"INVALID";
kit++; goto N;
}
}
gotoxy(57,24); dam();
return 8;
}
void no()
{
clrscr();
char ch;
layout(4,17);
gotoxy(6,21); cout<<"SORRY MR."<<l.mname<<',';
gotoxy(10,23);cout<<" YOU CANNOT CLAIM YOUR INSURANCE AS YOUR
POLICY IS NOT ACTIVE.";
getch();
home();
}
void dam()
{
27
clrscr();
layout(6,15);
textcolor(BROWN); gotoxy(32,17);
cprintf(" VEHICLE DETAILS");
gotoxy(12,20); cout<<"VEHICLE MODEL
: ............";
gotoxy(12,22); cout<<"VEHICLE REGISTRATION NUMBER
: ............";
gotoxy(12,24); cout<<"NO. OF MONTHS RUN BEFORE THIS
DAMAGE : ............";
gotoxy(12,26); cout<<"DAMAGES TO THE VEHICLE
: (1)......................";
gotoxy(12,28); cout<<"(ENTER NONE IF NO DAMAGE) : (2)......................";
gotoxy(12,30); cout<<"
: (3)......................";
q.input();
getch();
}
void in::input()
{
gotoxy(51,20); gets(mod);
gotoxy(51,24); cin>>mon;
gotoxy(47,28); gets(dam2);
gotoxy(51,22); gets(regno);
gotoxy(47,26); gets(dam1);
gotoxy(47,30); gets(dam3);
}
void hand()
{
clrscr();
int f;
layout(3,3); f=in();
gotoxy(7,9); cout<<"DEAR CUSTOMER, ";
gotoxy(20,11); cout<<"YOUR REQUEST HAS BEEN FORWARDED TO
MR."<<x[f].name;
gotoxy(20,13); cout<<"CLAIM HANDLER FOR "<<x[f].typ<<" . CLAIM
HANDLER NO. : "<<x[f].no;
gotoxy(20,15); cout<<"HIS CONTACT NO. IS "<<x[f].pno;
textcolor(GREEN); gotoxy(30,23);
cprintf("OTHER CLAIM HANDLERS");
for(int i=10;i<=72;i++)
{
gotoxy(i,25); cout<<'.';
gotoxy(i,28); cout<<'.';
gotoxy(i,33); cout<<'.';
gotoxy(i,38); cout<<'.';
gotoxy(i,43); cout<<'.';
}
for(i=25;i<=43;i++)
{
gotoxy(10,i); cout<<'.';
gotoxy(72,i); cout<<'.';
gotoxy(20,i); cout<<'.';
gotoxy(40,i); cout<<'.';
gotoxy(55,i); cout<<'.';
28
}
gotoxy(12,27);
gotoxy(22,27);
gotoxy(41,27);
gotoxy(57,27);
gotoxy(12,30);
gotoxy(22,30);
gotoxy(42,30);
gotoxy(58,30);
gotoxy(12,35);
gotoxy(22,35);
gotoxy(42,35);
gotoxy(58,35);
gotoxy(12,40);
gotoxy(22,40);
gotoxy(42,40);
gotoxy(58,40);
cout<<"CH NO.";
cout<<"CLAIM HANDLER NAME";
cout<<"HANDLES CLAIMS";
cout<<"CONTACT NUMBER";
cout<<x[0].no;
cout<<x[0].name;
cout<<x[0].typ;
cout<<x[0].pno;
cout<<x[1].no;
cout<<x[1].name;
cout<<x[1].typ;
cout<<x[1].pno;
cout<<x[2].no;
cout<<x[2].name;
cout<<x[2].typ;
cout<<x[2].pno;
getch();
}
int in()
{
x[0].no=2154; x[1].no=3152; x[2].no=4124;
strcpy(x[0].pno,"9445395038");
strcpy(x[1].pno,"9600085314");
strcpy(x[2].pno,"NIL");
strcpy(x[0].name,"STEVE AUSTIN"); strcpy(x[1].name,"ALBERTO DEL
RIO");
strcpy(x[2].name,"MATT PRIOR"); strcpy(x[1].typ,"INJURY");
strcpy(x[0].typ,"FATALITY");
strcpy(x[2].typ,"NON-INJURY");
if(v.fat=='Y') p=0;
else if(v.inj=='Y') p=1;
else p=2;
return p;
}
int valid()
{ifstream j;
j.open("b7report1.dat",ios::binary);
if(!j);
else while(!j.eof())
{j.read((char*)&h,sizeof(h));
if(h.mno==v.mno)
{if(comp(h.loss,v.r)==0) return 1;
if(comp(h.clm,v.t)==0) return 2; }
}
j.close();
return 0;
29
}
void end()
{
clrscr();
layout(5,18); cfile();
gotoxy(8,20); cout<<"MEMBER NUMBER : "<<l.mno;
gotoxy(15,23); cout<<"MR."<<l.mname;
textcolor(GREEN+BLINK); cprintf(" YOUR CLAIM WAS SUCCESSFULL !");
gotoxy(13,26); cout<<"YOU WILL GET $"<<v.amnt<<" WITHIN A WEEK
THROUGH POST TO YOUR ADDRESS";
gotoxy(25,29); cout<<"THANK U AND U ARE WELCOMED AGAIN";
cprintf(BLACK);
file4();
getch();
home();
}
void cfile()
{ input();
ifstream ki;
ki.open("b7memb.dat",ios::binary);
if(!ki);
while(!ki.eof())
{ ki.read((char *) &m,sizeof(m));
if(m.mno==v.mno) l=m;
}
int u=(l.pno%10)-1;
if(s[u].cv<v.amnt)v.amnt=s[u].cv;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////
/*REPORTS*/
class report1
{public:
dat loss,clm;
long int mno,cno,amnt;
}h,w;
void file4()
{ h.loss=v.r; h.clm=v.t;
h.cno=x[p].no; h.mno=v.mno;
h.amnt=v.amnt;
ofstream l;
l.open("b7report1.dat",ios::binary|ios::app);
30
if(!l);
l.write((char*)&h,sizeof(h));
l.close();
}
void trespass()
{clrscr();
int i; textcolor(RED+BLINK);
for( i=2;i<9;i++)
{gotoxy(i,18); cprintf("*");}
for(i=18;i<28;i++)
{gotoxy(5,i); cprintf("*");}
for( i=10;i<16;i++)
{gotoxy(i,18); cprintf("*");
gotoxy(i,22); cprintf("*");}
for(i=18;i<28;i++)
{gotoxy(10,i); cprintf("*");
if(i>21) {gotoxy(i-12,i);cprintf("*");}
else {gotoxy(15,i); cprintf("*"); }}
for( i=18;i<24;i++)
{gotoxy(i,18);
cprintf("*");
gotoxy(i,22);
cprintf("*");
gotoxy(i,27);
cprintf("*");
for(i=18;i<28;i++)
{gotoxy(18,i); cprintf("*");}
for( i=25;i<31;i++)
{gotoxy(i,18); cprintf("*");
gotoxy(i,22); cprintf("*");
gotoxy(i,27); cprintf("*");
for(i=18;i<28;i++)
{ if(i>22) {gotoxy(30,i); cprintf("*");}
else {gotoxy(25,i);cprintf("*"); }}
for(i=18;i<28;i++)
{ gotoxy(33,i); cprintf("*");
if(i<22){ gotoxy(38,i); cprintf("*");}
if(i<23)
{
gotoxy(16+i,18);
cprintf("*");
gotoxy(16+i,22);
cprintf("*");
}
}
for(i=18;i<28;i++)
{
gotoxy(40,i);
gotoxy(45,i);
if(i<23)
cprintf("*");
cprintf("*");
31
{
gotoxy(23+i,18);
gotoxy(23+i,22);
}
cprintf("*");
cprintf("*");
}
for( i=48;i<54;i++)
{gotoxy(i,18);
cprintf("*");
gotoxy(i,22);
cprintf("*");
gotoxy(i,27);
cprintf("*"); }
for(i=18;i<28;i++)
{ if(i>22) {gotoxy(53,i);cprintf("*"); }
else {gotoxy(48,i); cprintf("*");}}
for( i=55;i<61;i++)
{gotoxy(i,18);
cprintf("*");
gotoxy(i,22);
cprintf("*");
gotoxy(i,27);
cprintf("*"); }
for(i=18;i<28;i++)
{ if(i>22) {gotoxy(60,i); cprintf("*");}
else {gotoxy(55,i);cprintf("*"); }}
for( i=63;i<69;i++)
{gotoxy(i,18); cprintf("*");
gotoxy(i,22); cprintf("*");
gotoxy(i,27); cprintf("*");
for(i=18;i<28;i++)
{gotoxy(63,i); cprintf("*");}
for( i=70;i<76;i++)
{gotoxy(i,18); cprintf("*");
gotoxy(i,22);cprintf("*"); }
for(i=18;i<28;i++)
{gotoxy(70,i); cprintf("*");
if(i>21) {gotoxy(i+48,i);cprintf("*");} //69-22=47
else {gotoxy(75,i); cprintf("*"); }}
for(;1>0;) cout<<'\a';
}
int report()
{
clrscr();
layout(3,3);
char k,g[10],P[10],m;; int i,T=3,j=3;
if(JK==2) {JK=0;goto N;}
gotoxy(20,15); cout<<"ARE YOU A MANAGING OFFICIAL OF ABC ?
(Y/N) : ...";
gotoxy(66,15); cin>>m;
if(m!='Y') exit(0);
gotoxy(25,17); cout<<"ENTER PASS 1 : ";
32
K: i=0; gotoxy(43,17);
while((g[i]=getch())!='\r') //\n,\b warning needed
{
if(g[i]=='\b')
{
i--; gotoxy(43+i,17); cout<<' ';
gotoxy(43+i,17);
}
else
{
cout<<'*'; i++;
}
}
g[i]='\0';
gotoxy(30,19);
if(!strcmp(g,"GIRI")) cout<<"hi";
else {
T--; cout<<"YOU HAVE "<<T<<"
ATTEMPTS LEFT .";
if(T>0)
{
erase(43,17,10,' ');goto K;
}
else trespass();
}
erase(30,19,26,' ');
gotoxy(25,19); cout<<"ENTER PASS 2 : ";
l: i=0; gotoxy(43,19);
while( ( P[i]=getch() )!='\r' )
{
if(P[i]=='\b')
{
i--; gotoxy(43+i,19); cout<<' ';
gotoxy(43+i,19);
}
else
{
cout<<'*'; i++;
}
}
P[i]='\0';
gotoxy(30,21); if(!strcmp(P,"giri"));
else {
j--; cout<<"YOU HAVE "<<j<<"
ATTEMPTS LEFT .";
if(j>0) { erase(43,19,10,' '); goto
l; }
else trespass();
}
erase(30,21,26,' ');
for(i=4;i<77;i++) {gotoxy(i,23); cout<<'.';}
N:
33
A:
gotoxy(46,42); cin>>k;
if(k=='C'){clrscr();gotoxy(20,22); cout<<"GETTING INFO. FROM THE
DATABASE.. PLEASE WAIT"; fun(4,76,20,-81);report1();}
else if(k=='Z')home();
else if(k=='H'){clrscr();gotoxy(20,22);
cout<<"GETTING INFO. FROM THE DATABASE.. PLEASE WAIT"; fun(4,76,20,81); report2();}
else {gotoxy(30,44); cout<<"ENTER AGAIN"; goto A;}
getch();
return 0;
}
void report2()
{clrscr();
layout(10,18);
dat start,end;
int n1=0,n2=0,n3=0;
start.dd=1; start.yyyy=2011; end.yyyy=2011;
gotoxy(18,24); cout<<"ENTER THE QUARTER YOU ARE LOOKING
gotoxy(19,25); cout<<" FOR (1,2,3 or 4)IN THE YEAR 2011 : ...";
int t;
S:gotoxy(56,25); cin>>t;
switch(t)
{case 1:{ start.mm=1;end.dd=31;end.mm=3; break;}
case 2:{start.mm=4;end.dd=30;end.mm=6; break;}
case 3:{start.mm=7;end.dd=30;end.mm=9; break;}
case 4:{start.mm=10;end.dd=31;end.mm=12; break;}
default: goto S;}
in();
clrscr();
gotoxy(5,11); cout<<"QUARTER START DATE : "; start.display();
gotoxy(45,11); cout<<"QUARTER END DATE : "; end.display();
ifstream r;
r.open("b7report1.dat",ios::binary);
if(!r);
while(!r.eof())
{r.read((char*)&w,sizeof(w));
if(comp(w.clm,start)!=1 && comp(w.clm,end)!=-1)
{if(w.cno==1) n1++;
else if(w.cno==2) n2++;
else if(w.cno==3) n3++;
}
if(!r.eof()) break;
34
";
}
r.close();
for(int i=4;i<=79;i++)
{ gotoxy(i,15); cout<<'.';
gotoxy(i,23); cout<<'.';
gotoxy(i,33); cout<<'.';}
for(i=15;i<=33;i++)
{ gotoxy(4,i); cout<<'.';
gotoxy(13,i); cout<<'.';
gotoxy(49,i); cout<<'.';
gotoxy(i,18); cout<<'.';
gotoxy(i,28); cout<<'.';
gotoxy(79,i); cout<<'.';
gotoxy(33,i); cout<<'.';
gotoxy(62,i); cout<<'.';}
";
35
36
37
38
39
40
41
BIBILOGRAPHY
42