Project PaySlip 2016 Vishal.d
Project PaySlip 2016 Vishal.d
Project PaySlip 2016 Vishal.d
Sl.No
Contents
Page
Number
1.
Certificate
2.
Acknowledgment
3.
Project Introduction 5
4.
5.
6.
7.
Project Coding 10
8.
9.
Conclusion 29
10.
Bibliography
Page|2
30
26
2,
Certificate
The
Project
titled
as
____________________________
bonafied
work
of
is
Master /Miss
_________________________
Internal
Examiner
Deepak Gosain
PGT CS
Date:
_________
PRINCIPAL
External Examiner
Name:
Date: _________
Shri S.T.METRE
PRINCIPAL
Page|3
___________________
and
submitted
______________________
to
fulfill
the
by
partial
Master/Miss
requirement
of
in
the
subject
Computer Science.
ACKNOWLEDGEMENT
PROJECT
INTRODUCTION
wise
report
of
the
Page|5
An Intel based central processing unit capable of running any sort of windows operating
system such as Pentium based workstation.
A CD ROM drive
(B)
Turbo C++ 4.5 Editor is used for developing this project It is compiled at 32
bit windows mode.
Page|6
Laboratories
in
the
early
1980s
by
Bjarne
Rick Mascitti
where ++ is the C increment operator .Ever since its birth ,C++ evolved
to cope with problems encountered by users , and through discussions at
AT&T . However, the maturation of the C++ language was attested to by
two events:
I.
II.
The major reason behind the success and popularity of C++ is that
it supports the object oriented technology, the latest in the software
development and the most near to the real world .
One can easily judge the judge the importance of C++ as given in
the following lines:
Object
Oriented
Technology
is
regarded
as
the
ultimate
2. Data Encapsulation
4. Inheritance
3. Modularity
5. Polymorphism
Page|9
PROJECT
CODING
getdate(&ds);
cout<<" "<<ds.da_mon<<" - "<<ds.da_year;
}
ofstream fout;
ifstream fin;
class employee {
int empno,dept;
char name[25];
Date d,j;
P a g e | 10
public:
void add() //function to add new emp record
{
char blkch;
clrscr( );
cout<<"Enter new employee details......\n";
cout<<"\n\tEmployee Number [Numeric Value]: ";
cin>>empno;
cin.get(blkch);
cout<<"\n\tName of the
Employee: ";
cin.getline(name,25);
cout<<"\n\tDepartment Code [Numeric Value]: ";
cin>>dept;
cout<<"\n\tDate of Birth (dd-mmyy): ";
cin>>d.mm>>d.dd>>d.yy;
cin>>j.mm>>j.dd>>j.yy;
}
void show() // to display emp record
{
cout<<"\nEmp. No: ";
cout<<empno;
cout<<"\t Employee Name : ";
cout<<name;
cout<<"\t Dept. No. : ";
cout<<dept;
cout<<"\nDate of Birth : ";
cout<<d.mm<<"-"<<d.dd<<"-"<<d.yy;
cout<<"\t Date of Joining : ";
cout<<j.mm<<"-"<<j.dd<<"-"<<j.yy;
P a g e | 11
}
void report() // to display report in list form
{
gotoxy(3,k);
cout<<empno;
gotoxy(10,k);
puts(name);
gotoxy(20,k);
cout<<dept;
}
int retno() // accessors function
{
return(empno);
}
int retd() //accessors function
{
return(dept);
}
}; // end of class employee
class Salary: public employee // salary class inherited from employee
{
float
basic,gross,deduction,da,hra;
float
ot,oth,pf,lic,fadv,coops,hdfc,netpay;
int abdys;
public:
void add();
void show();
void report();
void
P a g e | 12
calculate();
void pay();
}sal;
void Salary::add() {
employee::add();
cout<<"\n\tBasic Pay: [Numeric
Value] ";
cin>>basic;
calculate();
fout.write((char *)&sal,sizeof(sal));
fout.close();
}
void Salary::calculate() {
hra=basic*0.1;
da=basic*0.225;
ot=oth*700;
pf=basic*0.1275;
fadv=.02*basic;
gross=basic+hra+da+ot;
deduction=pf+lic+fadv+coops+hdf
c;
netpay=gross-deduction;
}
void Salary::show() {
P a g e | 13
fin.open("database.dat",ios::binary);
fin.read((char*)&sal,sizeof(sal));
employee::show();
cout<<"\n\n\t\t\t\tNet pay: ";
cout<<netpay;
fin.close();
}
void Salary::report()
employee::report();
gotoxy(30,k);
cout<<basic;
gotoxy(42,k);
cout<<gross;
gotoxy(52,k);
cout<<deduction;
gotoxy(67,k);
cout<<netpay;
k=k+1;
if(k==50)
{
gotoxy(25,50);
cout<<"PRESS ANY KEY TO CONTINUE...";
getch();
k=7;
clrscr();
gotoxy(30,3);
P a g e | 14
cout<<" EMPLOYEE
DETAILS "; gotoxy(3,5);
cout<<"CODE";
gotoxy(10,5);
cout<<"NAME";
gotoxy(20,5);
cout<<"DEPT";
gotoxy(30,5);
cout<<"BASIC";
gotoxy(40,5);
cout<<"GROSS PAY";
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(67,5);
cout<<"NETPAY";
}
}
void Salary::pay() {
show(); // Display employee details
cout<<"\n*******************************************************
***"; cout<<"\n\t
GetSysDate();
cout<<"\n__________________________________________________________
_";
:"<<basic;
cout<<"\n\t\tDEARNESS ALLOWANCE
:"<<da;
:"<<hra;
:"<<oth;
:"<<ot;
:"<<gross;
cout<<"\n DEDUCTIONS.....................................";
cout<<"\n\t\tPROVIDENT FUND
cout<<"\n\t\tLIC
:"<<pf;
:"<<lic;
cout<<"\n\t\tIncome Tax
:"<<fadv;
cout<<"\n\t\tService Tax
:"<<hdfc;
cout<<"\n\t\tCO-OP Society
:"<<coops;
cout<<"\n__________________________________________________________
_"; cout<<"\n\t\tNET PAY
:Rs."<<netpay;
cout<<"\n**********************************************************
**";
}
void main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout<<setprecision(2);
menu:
clrscr();
gotoxy(25,2);
cout<<"Company Employee Management";
gotoxy(25,3);
cout<<"=======================
====\n\n";
cout<<"\n\t\t1.Salary
Report\n\n";
cout<<"\t\t2.Edit
Database\n\n";
cout<<"\t\t3.Search\n\n";
cout<<"\t\t4.Pay Slip\n\n";
cout<<"\t\t5.Exit\n\n";
cout<<"\t\tEnter Your Choice (any from 1,2,3,4,5): ";
P a g e | 16
int ch;
cin>>ch;
switch(ch)
{
case 1:ss:
clrscr(); gotoxy(25,2);
cout<<"Salary
Statement";
gotoxy(25,3);
cout<<"========
========\n\n";
cout<<"\n\t\t1.All
Employees\n\n";
cout<<"\t\t2.Departm
ent wise\n\n";
cout<<"\t\t3.Back to
Main menu\n\n";
cout<<"\t\tEnter Your Choice (any from 1,2,3): ";
int cho;
cin>>cho;
if(cho==1)
{clrscr();
gotoxy(30,3);
EMPLOYEE DETAILS ";
gotoxy(3,5);
cout<<"CODE";
gotoxy(10,5);
cout<<"NAME";
gotoxy(20,5);
cout<<"DEPT";
gotoxy(30,5);
cout<<"BASIC";
gotoxy(40,5);
cout<<"GROSS PAY";
P a g e | 17
cout<<"
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(67,5);
cout<<"NETPAY";
fin.open("database.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not
Found..."; goto menu;}
fin.seekg(0); while(!
fin.eof())
{fin.read((char*)&sal,size
of(sal)); if(!fin.eof())
sal.report();
}
getch();
fin.close();
}
if(cho==2)
{
flag=0;
cout<<"\n\t\tEnter Department: ";
int de;
cin>>de;
gotoxy(30,3);
EMPLOYEE DETAILS ";
gotoxy(3,5);
cout<<"CODE";
gotoxy(10,5);
cout<<"NAME";
gotoxy(20,5);
cout<<"DEPT";
gotoxy(30,5);
P a g e | 18
clrscr();
cout<<"
cout<<"BASIC";
gotoxy(40,5);
cout<<"GROSS PAY";
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(67,5);
cout<<"NETPAY";
fin.open("database.dat",ios::bi
nary); if(!fin)
{cout<<"\n\nFile Not
Found..."; goto menu;}
fin.seekg(0); while(!
fin.eof())
{fin.read((char*)&sal,sizeof(sal));
if(!fin.eof())
{int x=sal.employee::retd();
if(x==de)
{flag=1;
sal.report();}}}
if(flag==0)
{cout<<"\n\n\n\t\tDepartment doesnot exist...";
getch();
fin.close();
goto ss;}
getch();
fin.close();}
if(cho==3)
{goto
menu;}
ss;
case 2:
db:
P a g e | 19
goto
clrscr();
gotoxy(25,2);
cout<<"Employee Database";
gotoxy(25,3);
cout<<"=================\n\n";
cout<<"\n\t\t1.Add Employee Details\n\n";
cout<<"\t\t2.Edit Employee Details\n\n";
cout<<"\t\t3.Delete Employee\n\n";
cout<<"\t\t4.Back to Main Menu ";
int apc;
cin>>apc;
{
if(apc==1)
{
fout.open("database.dat",ios::binary|ios::app);
sal.add();
cout<<"\n\t\tEmployee Added Successfully!";
getch();
goto db;
}
if(apc==2)
{
int eno;
flag=0;
cout<<"\n\n\tEnter Employee Number to be Edited :";
cin>>eno;
fin.open("database.dat",ios::binary);
fout.open("database.dat",ios::binary|ios::app);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;}
fin.seekg(0);
r=0;
P a g e | 20
while(!fin.eof())
{
fin.read((char*)&sal,sizeof(sal));
if(!fin.eof())
{
r++;
int x=sal.employee::retno();
if(x==eno)
{
flag=1;
fout.seekp((r-1)*sizeof(sal));
clrscr();
cout<<"\n\t\tCurrent Details are\n";
sal.show();
cout<<"\n\n\t\tEnter New Details\n";
sal.add();
cout<<"\n\t\tEmployee Details editted";
}}}
if(flag==0)
{
cout<<"\n\t\tEmployee No does not exist...Please Retry!";
getch();
goto db;
}
fin.close();
getch();
goto db;
}
if(apc==3)
{
flag=0;
int eno;
P a g e | 21
{int
x=sal.employee::retno();
if(x!
=eno)
tmp.write((char*)&sal,sizeof(sal));
else
{
flag=1;
}}
fin.close();
tmp.close();
fout.open("database.dat",ios::trunc|ios::binary);
fout.seekp(0);
tmp.open("temp.dat",ios::binary|ios::in);
if(!tmp)
{
cout<<"Error in File";
goto db;
}
while(tmp.read((char*)&sal,sizeof(sal)))
fout.write((char*)&sal,sizeof(sal));
P a g e | 22
tmp.close();
fout.close();
if(flag==1)
cout<<"\n\t\tEmployee Succesfully Deleted";
else if (flag==0)
cout<<"\n\t\tEmployee does not Exist!
Please Retry"; getch(); goto db;
}
if(apc==4)
{
goto menu;
}
if(apc>4)
{
cout<<"\n\n\t\tWrong Choice!!! Retry";
getch();
goto db;
}
}
case 3:clrscr();
cout<<"\n\n\t\tEnter Employee Number to be found: ";
flag=0;
int eno;
cin>>eno;
fin.open("database.dat",ios::binary);
if(!fin)
{cout<<"\n\nFile Not Found...";
goto menu;}
fin.seekg(0);
while(fin.read((char*)&sal, sizeof(sal)))
{int x=sal.employee::retno();
if(x==eno)
{flag=1;
P a g e | 23
";
gotoxy(10,6);
cout<<"***************************************************";
gotoxy(10,8);
cout<<" C++ PROJECT FOR AISSCE 2016 PRACTICAL EXAMINATION
";
gotoxy(10,10);
cout<<"THIS PROJECT IS DEVELOPED BY D VISHAL OF K.V.2 HUBLI ";
gotoxy(10,12);
cout<<"THANKS TO DEEPAK GOSAIN SIR [PGT CS] FOR HELPING
ME"; gotoxy(10,13);
cout<<"***************************************************";
getch();
exit(0);
}
else if((yn=='N')||(yn=='n'))
goto menu;
else
{
goto menu;
}
default:
cout<<"\n\n\t\tWrong
Choice....Please
P a g e | 26
P a g e | 27
EMPLOYEE REPORT
CONCLUSION
The application certainly has some striking feature over manual
system. Some of the main feature of this project is as follows: User queries have become quite accurate and efficient.
P a g e | 28
BIBLIOGRAPHY
.
..
HELP PROVIDED BY PGT COMPUTER SCIENCE
MR. DEEPAK GOSAIN
P a g e | 30