Вы находитесь на странице: 1из 21

Bonafide

Certificate

This is to certify that


.. is a
certified student of class XIIth of Rani Laxmi Bai
Memorial Seniour Secondry School affiliated by CBSE
board and has successfully completed the project on
Payroll Management system under the guidance
of computer faculty Mrs. JYOTIMaam.

Teachers Signature:.

Principals Signature:.

1
ACKNOWLEDGMENT

I express my acknowledgment with deep sense of gratitude for my


project guide or faculty Mrs. JYOTI maam for his full support and
effective guidance which have provided immense help in my training
period. His constant inspiration and valuable time throughout the
project development made it feasible and easy to make the project a
success and in a very good way.

Last but not the least, I would acknowledge my immense regards


for my parents and my family whose constant encouragement and
support was the main source of energy and hard work behind this
project.

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.

The main modules used in this program are:

Add records
Automatically wage calculation
Search records of the employee
Modify existing record

3
Delete existing records
View all records of the employee

Hardware and Software


Requirement

To run this project successfully following are the requirements (minimum


requirement) of hardware and software that must exist:

Hardware Requirements:-

Coloured Monitor
Pentium 3, Pentium 4 or higher capacity processor
Ram(256 MB) or higher
Hard disk Space 1GB minimum

Software Requirement:-

Windows 98,2000,xp or higher operating System


Turbo c++ compiler or visual Basics 6.0

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();
};

/* function to add employee record */

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();
}

/* function to show all records of all the employee */

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();
}

/* function to search the record of a particular employee on the basis of employee id */

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();
}

/* function to delete a particular record of the employee */

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");
}

/* function to modify a particular record of the employee */

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 employee id: 100

enter the employee name: akhil verma

enter the date of birth: 16-10-1990

enter the address: plot no.18, pragti vihar, kalyanpur west, lucknow

enter the occupation: programmer

enter the salary:2000

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

enter the employee id: 101

enter the employee name: sneha ulal

enter the date of birth: 11-06-1999

enter the address: 1/654,vikas nagar, lucknow

enter the occupation: adviser

enter the salary:4000

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 employee id: 102

enter the employee name: madhu singh

enter the date of birth: 03-03-1991

enter the address: a-30, ahilya bai nagar,kalyanpur west

enter the occupation: saler

enter the salary:3000

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

enter the id:101

the employee id: 101


the employee name: sneha ulal
the date of birth: 11-06-1999
the address: 1/654,vikas nagar, lucknow
the occupation: adviser
basic sal: 4000
da: 100
ta: 300
hra: 500
net salary: 4900

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

enter the id:102

the employee id: 102


the employee name: madhu singh
the date of birth: 03-03-1991
the address: a-30, ahilya bai nagar,kalyanpur west
the occupation: saler
basic sal: 3000
da: 100
ta: 300
hra: 500

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

enter the id:100

the employee id: 100


the employee name: akhil verma
the date of birth: 16-10-1990
the address: plot no.18, pragti vihar, kalyanpur west, lucknow
the occupation: programmer
basic sal: 2000
da: 100
ta: 300
hra: 500
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: 5

the employee id: 100


the employee name: akhil verma
the date of birth: 16-10-1990
the address: plot no.18, pragti vihar, kalyanpur west, lucknow
the occupation: programmer
basic sal: 2000
da: 100
ta: 300
hra: 500

16
net salary: 2900

the employee id: 101


the employee name: sneha ulal
the date of birth: 11-06-1999
the address: 1/654,vikas nagar, lucknow
the occupation: adviser
basic sal: 4000
da: 100
ta: 300
hra: 500
net salary: 4900

the employee id: 102


the employee name: madhu singh
the date of birth: 03-03-1991
the address: a-30, ahilya bai nagar,kalyanpur west
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: 3

enter the id: 100

enter the employee name: akhil singh

enter the date of birth: 16-10-1988

enter the address: plot no.18, pragti vihar, kalyanpur west, lucknow

enter the occupation: assistant programmer

17
enter the salary:2000

record modified successfully

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

the employee id: 100


the employee name: akhil singh
the date of birth: 16-10-1988
the address: plot no.18, pragti vihar, kalyanpur west, lucknow
the occupation: assistant programmer
basic sal: 2000
da: 100
ta: 300
hra: 500
net salary: 2900

the employee id: 101


the employee name: sneha ulal
the date of birth: 11-06-1999
the address: 1/654,vikas nagar, lucknow
the occupation: adviser
basic sal: 4000
da: 100
ta: 300
hra: 500
net salary: 4900

the employee id: 102


the employee name: madhu singh
the date of birth: 03-03-1991
the address: a-30, ahilya bai nagar,kalyanpur west
the occupation: saler
basic sal: 3000

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

enter the id: 100

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

the employee id: 101


the employee name: sneha ulal
the date of birth: 11-06-1999
the address: 1/654,vikas nagar, lucknow
the occupation: adviser
basic sal: 4000
da: 100
ta: 300
hra: 500
net salary: 4900

the employee id: 102


the employee name: madhu singh
the date of birth: 03-03-1991
the address: a-30, ahilya bai nagar,kalyanpur west

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

enter the id: 101

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

the employee id: 102


the employee name: madhu singh
the date of birth: 03-03-1991
the address: a-30, ahilya bai nagar,kalyanpur west
the occupation: saler
basic sal: 3000
da: 100
ta: 300
hra: 500
net salary: 3900

20
Bibiliography

Computer Science with C++ -


Sumita Arora

Getting Started With C++ -


E. Balagrusamy

21

Вам также может понравиться