Beruflich Dokumente
Kultur Dokumente
Certificate
Teachers Signature:.
Principals Signature:.
1
ACKNOWLEDGMENT
2
INTRODUCTION
The payroll management system is mainly concerned to keep track of various steps that are undertaken by
the payroll department of the co-operates and organizations.
In project payroll management system the client wants a system that can be used to check the records that
the projects had made which the project had made and can handle the tasks of payroll department.
The client of the project can monitor progress made by the developing organization. He will be authorized
to check the progress of all the records running under the organization
The main aim of this project is to reduce the manual work of the staff thus increasing the efficiency of the
existing workflow. The are very much chances of errors in record maintainace. The record of the
employee can be maintained safe in digital form ,moreover user can search his record and can even
modify it according to its need.
This can be performed by using the employee id.
Add records
Automatically wage calculation
Search records of the employee
Modify existing record
3
Delete existing records
View all records of the employee
Hardware Requirements:-
Coloured Monitor
Pentium 3, Pentium 4 or higher capacity processor
Ram(256 MB) or higher
Hard disk Space 1GB minimum
Software Requirement:-
4
Coding and
Output
5
CODING
/* program for employee record and payroll management */
#include<stdio.h>
#include<fstream.h>
#include<process.h>
#include<conio.h>
struct emp //definng structure for keeping the record of the employee
{
int id;
char nm[30],dob[10],address[60],job[25];
float sal,hra,da,ta,netsal;
};
class employee
{
emp e;
public:
void add_data();
6
void modify_data();
void search_data();
void delete_data();
void show_data();
};
void employee::add_data()
{
ofstream f("emp.txt",ios::app|ios::binary);
cout<<"\nenter the employee id: ";
cin>>e.id;
cout<<"\nenter the employee name: ";
cin.getline(e.nm,30);
cout<<"\nenter the date of birth: ";
cin.getline(e.dob,10);
cout<<"\nenter the address: ";
cin.getline(e.address,60);
cout<<"\nenter the occupation: ";
cin.getline(e.job,25);
cout<<"\nenter the salary:";
cin>>e.sal;
if(e.sal<=5000)
{
e.da=100;
e.ta=300;
e.hra=500;
}
else if(e.sal>5000 && e.sal<=15500)
{
e.da=300;
e.ta=500;
e.hra=800;
}
else
{
e.da=500;
e.ta=800;
e.hra=1000;
}
7
e.netsal=e.sal+e.da+e.ta+e.hra;
f.write((char *)&e,sizeof(e));
f.close();
}
void employee::show_data()
{
ifstream f("emp.txt",ios::in|ios::binary);
if(!f)
{
cout<<"there is no record";
return;
}
while(f.read((char *)&e,sizeof(e)))
{
cout<<"\nthe employee id: "<<e.id;
cout<<"\nthe employee name: "<<e.nm;
cout<<"\nthe date of birth: "<<e.dob;
cout<<"\nthe address: "<<e.address;
cout<<"\nthe occupation: "<<e.job;
cout<<"\nbasic sal: "<<e.sal;
cout<<"\nda: "<<e.da;
cout<<"\nta: "<<e.ta;
cout<<"\nhra: "<<e.hra;
cout<<"\nnet salary: "<<e.netsal;
cout<<"\n";
}
f.close();
}
void employee::search_data()
{
int id1;
ifstream f("emp.txt",ios::in|ios::binary);
if(!f)
{
8
cout<<"there is no record";
return;
}
f.seekg(0);
cout<<"\nenter the id:";
cin>>id1;
while(f.read((char *)&e,sizeof(e)))
{
if(id1==e.id)
{
cout<<"\nthe employee id: "<<e.id;
cout<<"\nthe employee name: "<<e.nm;
cout<<"\nthe date of birth: "<<e.dob;
cout<<"\nthe address: "<<e.address;
cout<<"\nthe occupation: "<<e.job;
cout<<"\nbasic sal: "<<e.sal;
cout<<"\nda: "<<e.da;
cout<<"\nta: "<<e.ta;
cout<<"\nhra: "<<e.hra;
cout<<"\nnet salary: "<<e.netsal;
cout<<"\n";
return;
}
}
cout<<"\nthere is no such record";
f.close();
}
void employee::delete_data()
{
int id1;
ifstream f("emp.txt",ios::binary);
if(!f)
{
cout<<"\nthere is no any record";
return;
}
ofstream k("temp.txt",ios::binary);
cout<<"\nenter the id: ";
9
cin>>id1;
while(f.read((char *)&e,sizeof(e)))
{
if(id1!=e.id)
{
k.write((char *)&e,sizeof(e));
}
if(id1==e.id)
{
cout<<"\nrecord deleted\n";
}
}
k.close();
f.close();
remove("emp.txt");
rename("temp.txt","emp.txt");
}
void employee::modify_data()
{
int id1;
ifstream f("emp.txt",ios::binary);
if(!f)
{
cout<<"there is no record";
return;
}
ofstream k("temp.txt",ios::binary);
cout<<"\nenter the id";
cin>>id1;
while(f.read((char *)&e,sizeof(e)))
{
if(id1==e.id)
{
cout<<"\nrecord found";
cout<<"\nenter the employee name: ";
cin>>e.nm;
cout<<"\nenter the date of birth: ";
cin>>e.dob;
10
cout<<"\nenter the address: ";
cin>>e.address;
cout<<"\nenter the occupation: ";
cin>>e.job;
cout<<"enter the salary:";
cin>>e.sal;
if(e.sal<=5000)
{
e.da=100;
e.ta=300;
e.hra=500;
}
else if(e.sal>5000 && e.sal<=15500)
{
e.da=300;
e.ta=500;
e.hra=800;
}
else
{
e.da=500;
e.ta=800;
e.hra=1000;
}
e.netsal=e.sal+e.da+e.ta+e.hra;
cout<<\nrecord modified successfully\n;
}
k.write((char *)&e,sizeof(e));
}
k.close();
f.close();
remove("emp.txt");
rename("temp.txt","emp.txt");
}
void main()
{
clrscr();
int i;
employee et;
while(1)
11
{
cout<<"\n menu";
cout<<"\n 1.) enter the record";
cout<<"\n 2.) search the record";
cout<<"\n 3.) modify the record";
cout<<"\n 4.) delete the record";
cout<<"\n 5.) show all the record";
cout<<"\n 6.) exit";
cout<<"\n enter the choice: ";
cin>>i;
switch(i)
{
case 1:
et.add_data();
break;
case 2:
et.search_data();
break;
case 3:
et.modify_data();
break;
case 4:
et.delete_data();
break;
case 5:
et.show_data();
break;
case 6:
exit(0);
default:
cout<<"wrong choice";
}
}
getch();
}
12
OUTPUT
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 1
enter the address: plot no.18, pragti vihar, kalyanpur west, lucknow
13
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 1
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 1
14
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice:2
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 2
15
net salary: 3900
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 2
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 5
16
net salary: 2900
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 3
enter the address: plot no.18, pragti vihar, kalyanpur west, lucknow
17
enter the salary:2000
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 5
18
da: 100
ta: 300
hra: 500
net salary: 3900
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 4
record deleted
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 5
19
the occupation: saler
basic sal: 3000
da: 100
ta: 300
hra: 500
net salary: 3900
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 4
record deleted
menu
1.) enter the record
2.) search the record
3.) modify the record
4.) delete the record
5.) show all the record
6.) exit
enter the choice: 5
20
Bibiliography
21