Submitted by Editor
Payroll Management
#include
#include
#include
#include
#include
#include
#include
#include
struct roll
{
char na[20],des[20];
int co;
float sal,tax,hra,gr,da,np;
}oll;
fstream pay;
char c;
int l;
char choice;
void dev()
{
clrscr();
for(int x=50;x>=20;x--)
{
textcolor(WHITE+LIGHTGRAY);
delay(160);
gotoxy(x,12);
cputs(" P R O J E C T ");
gotoxy(x,14);
cputs(" D E V E L O P E D B Y : ");
gotoxy(x,16);
cputs("Navi");
}
gotoxy(x,24);
cputs("PRESS ANY KEY TO CONTINUE");
getch();
}
void main()
{
clrscr();
dev();
int gdriver=DETECT,gmode,errorcode;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi");
errorcode=graphresult();
if(errorcode!=grOk)
{
cout< >eno;
pay.open("oll.dat",ios::in);
if(!pay)
{
cout< <"\n\nFile Not Found...\nProgram Terminated!";
exit(0);
}
pay.seekg(0);
while(!pay.eof())
{
pay.read((char*)&oll,sizeof(oll));
if(!pay.eof())
{
if(oll.co==eno)
{
cout<<"\n*********************************************";
cout<<"\n SUSHMA ENTERPRISES ";
cout<<"\n*********************************************";
cout<<"\nEMPLOYEE CODE :"<>oll.na;
cout< <"\n EMPLOYEE CODE";
cin>>oll.co;
cout< <"\n EMPLOYEE DESIGNATION:";
int ch;
cout<<"\n1.SUBSTAFF";
cout<<"\n2.CLERK";
cout<<"\n3.MANAGER";
cout<<"\n ENTER YOUR CHOICE:(1/2/3)";
cin>>ch;
switch(ch)
{
case 1:
oll.sal=1000;
oll.hra=100;
oll.da=oll.sal*1.10;
oll.tax=2*(oll.sal)/100.0;
strcpy(oll.des,"SUBSTAFF");
break;
case 2:
oll.sal=2000;
oll.hra=200;
oll.da=200;
oll.tax=10*(oll.sal)/100.0;
strcpy(oll.des,"CLERK");
break;
case 3:
oll.sal=14000;
oll.hra=400;
oll.da=400;
oll.tax=20*(oll.sal)/100.0;
strcpy(oll.des,"MANAGER");
break;
default:cout< <"\n INPUT IS INVALID";
break;
}
oll.gr=oll.sal+oll.hra+oll.da;
oll.np=oll.gr-oll.tax;
pay.write((char*)&oll,sizeof(oll));
cout<<"\n TO CONTINUE ADDING DATA(Y/N):";
cin>>c;
}while((c=='Y')||(c=='y'));
pay.close();
break;
case'4':
exit(0);
}
}
while(choice!=4);
closegraph();
}
0 Comments:
Life isn't about finding yourself. Life is about creating yourself. - George Bernard Shaw