PAYROLL SYSTEM
KURUKSHETRA
UNIVERSITY,
KURUKSHETRA
1
A PROJECT REPORT ON
COMPUTERIZED
PAYROLL SYSTEM
SUBMITTED TO
2
KURUKSHETRA
UNIVERSITY
CERTIFICATE
Supervisor :
K.U.,Kurukshetra
3
ACKNOWLEDGMENT
4
BCA-III
Kurushetra University
University Roll No: 680155
CONTENTS
Requirements.
Introduction.
System Development Life Cycle.
System Life Cycle Activities.
Information Gathering~
Information About Firm.
Information About Staff.
Information About Work Flow.
Feasibility Study.
System Design~
Logical Design.
Physical Design.
Input Design.
Output Design.
Analysis.
5
Implementation.
Introduction.
What is C++?
What is Object-Oriented Paradigm
Basic Concept Of OOP.
Application Of C++.
Output.
Conclusions~
References.
6
REQUIREMENTS FOR RUNNING
THE PROJECT
RAM: MINIMUM OF
PRINTER: ANY
7
8
INTRODUCTION
designing the system after analyzing the pros and cons of the proposed
system. This involves a lot of theoretical study and paperwork and then the
designing. This is the time consuming process. The analysis works with the
user to identify goals and build system and achieve them. Any system in the
world has to go through life cycle having different phases. In this section we
9
SYSTEM DEVELOPMENT LIFE CYCLE
becomes crucial. They are confronted with the challenging task of creating
candidate system has a life cycle. It has to go through various stages. The
sequence these activities for learning purposes, but in real life they overlap
10
SYSTEM LIFE CYCLE ACTIVITIES
The different activities that constitute the life cycle of the system
general the six activities that form the life cycle of the system are given
below:-
Recognition Of Need.
Feasibility Study.
Analysis.
Design.
Implementation.
11
INFORMATION GATHERING
The kind of information we needed for our system was about the user staff.
12
INFORMATION ABOUT THE FIRM
the structure explains the kind of environment that promotes the introduction
and the direction system development will follow objectives and milestones
manuals, orientation pamphlets. Annual company report and the like help an
13
INFORMATION ABOUT THE STAFF
The information about the user staff gives the knowledge about the
people who run the present system – their job functions and information
Gathering the information of this kind established a basis for determining the
14
INFORMATION ABOUT WORK FLOW
Work Flow focuses on what happens to the data through various point
processing point in the system and the direction it takes from source to
destination.
available from such charts explains the procedure used for performing task
15
INFORMATION GATHERING TOOL USED
ON-SITE OBSERVATIONS:
present system.
being studied. For this, it is important to have the knowledge of the general
16
RECOGNITION OF NEED
One must know what the problem is before it can be solved. The
report we first work out on the problem i.e. we first face the question of need
accessibility simpler.
17
FEASIBILITY STUDY
While developing a computer system, the main objective of
We can do this investigation the existing system in the area creating idea
about a new system. The proposed system must be tested for technical
feasibility.
programs, procedures and tools for storing and handling date. It includes
SOFTWARE REQUIREMENT
HARWARE REQUIREMENT
18
ASSESSING ECONOMIC FEASIBILITY
the best return at the earliest opportunity. The cost benefits analysis is
19
relationship, salary and job should be considered.
Information has been gathered to verify the problem and evaluate the
existing system.
The features and reasons behind the new (proposed) system make
sense.
20
LOGICAL DESIGN
and most of the input functions. It includes the flow of document from
21
PHYSICAL DESIGN
proposed system must do. In turn, we wrote the necessary program that:
such a way that it displays menu that specify how to do the desired
operation.
22
INPUT DESIGN
Input design is the process of converting user-originated inputs to
diagrams identify logical data flows, data stores, sources and destination.
Input data are collected and organized into groups of similar data using
INPUT DATA:
The goal here is to make entry as easy, logical and free from errors
as possible.
and data from the operator through the keyboard. The processor analyzes
requested. The request for the input is in the form of a message displayed
on the screen.
The approach used for entering the data is the Menu Approach.
The menu is the selection list that simplifies computer data access or
23
entry.
OUTPUT DESIGN
Computer output is the most important and direct source of
displayed on the CRT screen. The output can be obtained as hard copy
MICR Readers.
Graph Plotters.
Audio Response.
24
SYSTEM ANALYSIS
It is always wise to look ahead, but is difficult to look further you can
see. Winston Churchills remarks point out the planning future endeavors,
Its includes: -
working an their records maintained in the file system which has a large
end of the month. When the period of their salary started. We observe all
25
whether they are satisfied or not, but the response was negative. They
defined records are maintained, some time get late and may be incorrect.
Data Collection:-
This was the second step in which I concern with
employee
employee
or not him/her.
26
This was the one of the time consuming process but I succeeded
sites, the telecommunication network and tests of the network along with
can be easily trained there are not many options to be filled by the user.
27
POST IMPLEMENTATION AND
MAINTEINANCE
After the installation phase is completed and the user staff is
28
29
INTRODUCTION TO C++
oriented language, which lacks certain features like pointers and multiple
30
HISTORY OF C++
C++ is an object-oriented language. It was developed Bjarne
of C, wanted to combine the best of both the languages and create a more
powerful language that cold support OOP features and still retains the power
with major addition of the class construct feature of Simula 67. Since the
called the new language ‘C With Classes’. However, later in 1983, the name
was changed to C++. The idea of C++ comes from the increment operator
C.
language specification.
31
WHAT IS OOP?
The major motivating factor in the invention of object-oriented
development and does not allow it to flow freely around the system. It
ties data more closely to the functions that operate on it, and protects it
then builds data and functions around these objects. The organization of
32
New data and functions can be easily added wherever necessary.
OBJECTS: -
item that the program has to handle. They may represent user-defined
data such as vectors, time and list. When a program is executed, the
CLASSES:-
The entire set of data and code of an object can be made user
defined type with the help of a class. Once a class has been defined,
object is associated with the data of type class with which they are
example mango, apple, banana etc. all are the members of class frit.
Classes are built- in data type and behave like built in types of a
programming language.
33
DATA ABSTRACTION & ENCAPSULATION: -
class. The data is not accessible to the outside world, and only those
functions, which are wrapped in the class, can access it. These
functions provide the interface between the object’s data and the
‘member functions’.
INHERITANCE: -
34
that each derived class shares common characteristics with the class
POLYMORPHISM:-
depends upon the type of data use in the operation. For example
Consider ‘+’ operator. For two numbers it will generate the sum, but
DYNAMIC BINDING: -
executed in response to the call. It mans that the code associated with
MESSAGE PASSING:-
therefore, involves:
35
APPLICATION OF C++
C++ is a versatile language for handling very large programs. It is
application systems.
While C++ is able to map the real world problems the C part of C+
+ gives the language the ability to get close to the machine
language details.
36
37
/* ************ PROJECT REPORT ON PAYROLL *******/
#include<string.h>
#include<ctype.h>
#include<stdio.h>
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdlib.h>
#include<graphics.h>
#include<dos.h>
int choice;
class grade
{
public:
char grade_id;
float hra,ta,da,pf,proff_tax;
void read();
void writetofile();
void readtofile();
void display();
}g;
void grade::read()
{
gotoxy(25,5);
cout<<"GRADE ENTERIES";
cout<<"\n\t============================================
==";
gotoxy(15,7);
cout<<"Grade_Id ";
gotoxy(15,9);
cout<<"HRA" ;
gotoxy(15,11);
38
cout<<"TA" ;
gotoxy(15,13);
cout<<"DA" ;
gotoxy(15,15);
cout<<"PF";
gotoxy(15,17);
cout<<"PROFESSIONAL TAX" ;
cout<<"\n\t============================================
==";
gotoxy(50,7);
cin>>grade_id;
int flag=0;
ifstream fout("grade",ios::in);
if(fout!=NULL)
{
while(flag==0)
{
fout.seekg(0);
grade g1;
int x=0;
while(fout.read((char*)&g1,sizeof(g1))!=NULL)
{
if(g1.grade_id==grade_id)
{
x=1;
gotoxy(23,23);
cout<<"Alredy exist";
gotoxy(50,7);
clreol();
gotoxy(50,7);
cin>>grade_id;
}
}
if(x==0)
flag=1;
fout.close();
}
}
39
gotoxy(50,9);
cin>>hra;
gotoxy(50,11);
cin>>ta;
gotoxy(50,13);
cin>>da;
gotoxy(50,15);
cin>>pf;
gotoxy(50,17);
cin>>proff_tax;
}
//**********************************************************
**************
void grade::writetofile()
{
ofstream fin("grade",ios::app);
fin.write((char*)this,sizeof(*this));
fin.close();
}
//**********************************************************
***************
void grade::readtofile()
{
ifstream fout("grade",ios::in);
fout.seekg(0);
clrscr();
cout<<" EMPLOYEE GRADE ";
cout<<"\n=============================================
====================";
cout<<"\n\n GRADE ID\t HRA\t TA\t DA\t PF\t PROFESSIONAL
TAX";
while(fout.read((char*)this,sizeof(*this))!=NULL)
{
display();
}
fout.close();
40
}
//**********************************************************
***************
void grade::display()
{
void gradeMaster()
{
menu:
clrscr();
cout<<"\n\n\t*********************************************
******";
cout<<"\n\n\t1.New Grade";
cout<<"\n\n\t2.View";
cout<<"\n\n\t3.Exit";
cout<<"\n\n\t*********************************************
******";
cout<<"\n\n\t Enter your choice...";
cin>>choice;
switch(choice)
{
case 1:
clrscr();
g.read();
g.writetofile();
getch();
clrscr();
goto menu;
case 2:
g.readtofile();
getch();
goto menu;
case 3:
break;
41
}
}
//******************** MODULE OF EMPLOYEE RECORDS
************************
class employee
{
float basic,netsal;
char emp_name[25],address[30];
public:
char grade_id;
int empcode;
void read();
void readtofile();
void writetofile();
void viewall();
void viewcode();
void viewname();
void netsalary();
void modifyname();
void deleterec();
void modifycode();
void display();
}e;
//**********************************************************
***************
void employee ::read()
{
clrscr();
for (int i=1;i<=75;i++)
cout<<"*";
gotoxy(20,3);
cout<<"EMPLOYEE RECORDS\n";
for (i=1;i<=75;i++)
cout<<"*";
gotoxy(15,6);
cout<<"code";
42
gotoxy(15,8);
cout<<"name";
gotoxy(15,10);
cout<<"basic";
gotoxy(15,12);
cout<<"address";
gotoxy(15,14);
cout<<"grade_id";
cout<<"\n";
for(i=1;i<=75;i++)
cout<<"*";
int max=0;
ifstream fin("employee",ios::in);
if(fin!=NULL)
{
fin.seekg(0);
while (fin.read((char*)this,sizeof(*this))!=NULL)
{
if (max<empcode)
max=empcode;
}
fin.close();
}
empcode=max+1;
gotoxy(30,6);
cout<<empcode;
gotoxy(30,8);
fflush(stdin);
gets(emp_name);
gotoxy(30,10);
cin>>basic;
gotoxy(30,12);
gets(address);
gotoxy(30,14);
int flag=0;
grade gr;
while(flag==0)
{
cin>>grade_id;
43
ifstream fout("grade",ios::in);
if(fout==NULL)
break;
fout.seekg(0);
while(fout.read((char*)&gr,sizeof(gr))!=NULL)
{
if(toupper(grade_id)==toupper(gr.grade_id))
{
netsalary();
flag=1;
}
}
if (flag==0)
{
gotoxy(30,14);
clreol();
gotoxy(30,14);
}
}
}
//**********************************************************
*****************
void employee::writetofile()
{
ofstream fin("employee",ios::app);
fin.write((char*)this,sizeof(*this));
fin.close();
}
//**********************************************************
****************
void employee::readtofile()
{
menu:
clrscr();
for(int i=0;i<=70;i++)
cout<<"=";
44
cout<<"\n";
for(i=0;i<=70;i++)
cout<<"=";
cout<<"\n\n\tEnter your choice.....";
cin>>choice;
switch(choice)
{
case 1:
e.viewall();
getch();
goto menu;
case 2:
e.viewname();
getch();
goto menu;
case 3:
e.viewcode();
getch();
goto menu;
case 4:
e.netsalary();
getch();
goto menu;
case 5:
break;
}
}
//***********************VIEW RECORD BY
ALL*********************************
void employee::viewall()
{
clrscr();
cout<<" EMPLOYEE RECORD ";
cout<<"\n\t
=========================================";
// cout<<"\nCODE\tNAME\t\tAddress\tBASIC\tGRADE";
45
ifstream fout("employee",ios::in);
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)this,sizeof(*this))!=NULL)
{
display();
}
}
fout.close();
}
//**********************VIEW RECORD BY
NAME********************************
void employee::viewname()
{
clrscr();
char name[20];
cout<<"\nEnter the name of the Employee : " ;
gets(name);
ifstream fout("employee",ios::in);
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)this,sizeof(*this))!=NULL)
{
if(strcmp(name,emp_name)==0)
{
display();
}
}
}
fout.close();
}
//*************************VIEW RECORD BY
ID*******************************
void employee::viewcode()
{
int code;
46
cout<<"Enter Employee code";
cin>>code;
ifstream fout("employee",ios::in);
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)this,sizeof(*this))!=NULL)
{
if(code==empcode)
{
display();
}
}
}
fout.close();
}
//********************VIEW OF NETSAL
RECORD*****************************
void employee::netsalary()
{
float hra,ta,da,pf,proff_tax;
char grade_id;
cout<<"\n\nEnter grade_id..";
cin>>grade_id;
ifstream fout("grade",ios::in);
grade gr;
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)&gr,sizeof(gr))!=NULL)
{
if (toupper(gr.grade_id)==toupper(grade_id))
{
hra=(float)gr.hra/100*basic;
ta=(float)gr.ta/100*basic;
da=(float)gr.da/100*basic;
pf=(float)gr.pf/100*basic;
47
proff_tax=gr.proff_tax;
netsal=basic+hra+ta+da-pf-proff_tax;
display();
cout<<"\nNetSal..."<<netsal;
}
}
}
fout.close();
//**********************************************************
***************
void employee::display()
{
cout<<"\ncode:\t"<<empcode<<"\nname:\t"<<emp_name<<"\nadd:\t";
cout<<address<<"\nbasic:\t"<<basic<<"\nId:\t"<<grade_id;
"\n*************************\n";
//********************MODIFY RECORD BY
NAME********************************
void employee::modifyname()
{
char ch,name[20];
cout<<"Enter Employee Name...";
fflush(stdin);
gets(name);
ifstream fout("employee",ios::in);
ofstream fin("tempemp",ios::out);
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)this,sizeof(*this))!=NULL)
{
if(strcmp(name,emp_name)==0)
48
{
cout<<"Are U Sure to Modify the Record";
cin>>ch;
if(ch=='y')
{
e.read();
fin.write((char*)this,sizeof(*this));
}
else
fin.write((char*)this,sizeof(*this));
}
else
fin.write((char*)this,sizeof(*this));
}
}
remove("employee");
rename("tempemp","employee");
fin.close();
fout.close();
cout<<"\nRECORD MODIFIED";
49
{
if(code==empcode)
{
cout<<"Are U Sure to Modify the Record";
cin>>ch;
if(ch=='y')
{
e.read();
fin.write((char*)this,sizeof(*this));
}
else
fin.write((char*)this,sizeof(*this));
}
else
fin.write((char*)this,sizeof(*this));
}
}
remove("employee");
rename("tempemp","employee");
fin.close();
fout.close();
cout<<"\nRECORD MODIFIED";
void employee::deleterec()
{
char ch;
int code;
cout<<"Enter the employee code to delete the record";
cin>>code;
fstream fin("employee",ios::in);
50
ofstream fout("temp",ios::out);
if(fin!=NULL)
{
fin.seekg(0);
while(fin.read((char*)this,sizeof(*this))!=NULL)
{
if(code==empcode)
{
cout<<"Are u sure to delete the record";
cin>>ch;
if((ch=='y')||(ch=='Y'))
{}
else
fout.write((char*)this,sizeof(*this));
}
else
fout.write((char*)this,sizeof(*this));
}
}
remove("employee");
rename("temp","employee");
fin.close();
fout.close();
}
//***********************MAIN EMPLOYEE
FUNCTION*****************************
void employeeMaster()
{
menu:
clrscr();
cout<<"\n\n";
for(int i=1;i<=75;i++)
cout<<"*";
51
gotoxy(20,4);
cout<<"\tEMPLOYEE RECORDS\n";
for(i=1;i<=75;i++)
cout<<"*";
cout<<"\n\n\t1.NEW";
cout<<"\n\n\t2.VIEW";
cout<<"\n\n\t3.Modify";
cout<<"\n\n\t4.DELETE";
cout<<"\n\n\t5.EXIT\n";
for( i=1;i<=75;i++)
cout<<"*";
gotoxy(22,18);
cout<<"Enter your choice...";
cin>>choice;
switch(choice)
{
case 1:
e.read();
e.writetofile();
getch();
clrscr();
goto menu;
case 2:
e.readtofile();
getch();
goto menu;
case 3:
menu1:
clrscr();
cout<<"\n1.Modify record by name";
cout<<"\n2.Modify record by Code" ;
cout<<"\n3.Exit";
cout<<"\n\tEnter your choice";
cin>>choice;
switch(choice)
{
case 1:
e.modifyname();
getch();
52
goto menu1;
case 2:
e.modifycode();
getch();
goto menu1;
case 3:
goto menu;
}
break;
case 4:
e.deleterec();
getch();
goto menu;
case 5:
break;
}
// *******************************PAYSLIP
MODULE***************************
class payslip
{
int empcode;
int month,year;
public:
struct date current_date;
void read();
void writetofile();
void issue();
void readtofile(int,int,int);
void report(int,int);
void display();
}p;
void payslip::read()
{
cout<<"\nEnter Employee Code...";
cin>>empcode;
ifstream fin("employee",ios::in);
53
employee e1;
if(fin!=NULL)
{
fin.seekg(0);
while(fin.read((char*)&e1,sizeof(e1))!=NULL)
{
if(empcode==e1.empcode)
{
e1.display();
ifstream fin1("grade",ios::in);
grade tgrade;
if(fin1!=NULL)
{
fin1.seekg(0);
while(fin1.read((char*)&tgrade,sizeof(tgrade))!=NULL)
{
if(e1.grade_id==tgrade.grade_id)
{
tgrade.display();
}
}
}
fin1.close();
}
}
fin.close();
}
ifstream f("payslip",ios::in);
int flag=0;
if(f!=NULL)
{
f.seekg(0);
payslip temp;
while(f.read((char*)&temp,sizeof(temp))!=NULL)
{
if(temp.empcode==empcode&&temp.month==month&&temp.year==yea
r)
54
flag=1;
}
f.close();
}
if(flag==1)
cout<<"Alrady Exist";
else
writetofile();
}
//*********************************************************
**********
void payslip::readtofile(int ecode,int m,int y)
{
ifstream fin("payslip",ios::in);
if(fin!=NULL)
{
fin.seekg(0);
while(fin.read((char*)this,sizeof(*this))!=NULL)
{
if(empcode==ecode && m==month && y==year)
display();
}
}
fin.close();
}
//**********************************************************
****************
void payslip::writetofile()
{
ofstream fout("payslip",ios::app);
fout.write((char*)this,sizeof(*this));
fout.close();
}
//**********************************************************
**************
void payslip::issue()
{
cout<<"\nEnter month";
cin>>month;
55
cout<<"\nEnter Year";
cin>>year;
getdate(¤t_date);
if((month==(int)current_date.da_mon-
1)&&(year==current_date.da_year))
read();
else
cout<<"Already Issued\n";
}
//*****************************Payslip
Master******************************
void payslipMaster()
{
int ecode,m,y,a;
payslipmenu:
clrscr();
case 3:
break;
56
}
}
//**********************************************************
**************
void payslip::display()
{
clrscr();
cout<<"\n";
for(int i=1;i<=72;i++)
cout<<"*";
cout<<"\n"<<month<<"\t"<<year<<"\t"<<(int)current_date.da_day;
cout<<"-"<<(int)current_date.da_mon;
cout<<"-"<<current_date.da_year;
cout<<"\n";
for(i=1;i<=72;i++)
cout<<"*";
}
//*********************************************************
****************
void fscreen()
{
int gm=DETECT;
initgraph(&gm,&gm,"");
setcolor(BLUE);
rectangle(10,10,630,470);
rectangle(20,20,620,460);
setbkcolor(WHITE);
setcolor(RED);
for(int i=15;i>0;i--)
{
settextstyle(GOTHIC_FONT,HORIZ_DIR,5);
setcolor(i);
outtextxy(150,50,"PROJECT REPORT ");
settextstyle(GOTHIC_FONT,HORIZ_DIR,5);
setcolor(BLUE);
outtextxy(320,100,"ON");
settextstyle(GOTHIC_FONT,HORIZ_DIR,6);
57
sleep(1);
setcolor(i);
outtextxy(100,150,"PAYROLL SYSTEM ");
}
settextstyle(TRIPLEX_FONT,HORIZ_DIR,4);
setcolor(BLUE);
sleep(2);
outtextxy(330,250,"PRIYANKA RANI ");
sleep(1);
outtextxy(330,280,"BCA -III");
sleep(1);
outtextxy(330,310,"K.U ");
sleep(1);
outtextxy(330,340,"KURUKSHETRA ");
getch();
closegraph();
}
void lastscreen()
{
int gm=DETECT;
initgraph(&gm,&gm,"");
setcolor(YELLOW);
rectangle(10,10,630,470);
rectangle(20,20,620,460);
setbkcolor(RED);
settextstyle(TRIPLEX_FONT,HORIZ_DIR,7);
outtextxy(190,150,"THANKS");
getch();
closegraph();
}
// ******************************MAIN
MENU**********************************
void main()
{
fscreen();
mainmenu:
clrscr();
58
cout<<"\n\n
***********************************************************
****";
gotoxy(20,4);
cout<<" PROJECT REPORT ON PAYROLL";
cout<<"\n
***********************************************************
****";
cout<<"\n\n\t1.Grade Master";
cout<<"\n\n\t2.Employee Master";
cout<<"\n\n\t3.Payslip Master";
cout<<"\n\n\t4.Exit";
cout<<"\n\n
***********************************************************
****";
cout<<"\n\n\t\tEnter your choice....";
cin>>choice;
switch(choice)
{
case 1:
gradeMaster();
goto mainmenu;
case 2:
employeeMaster();
goto mainmenu;
case 3:
payslipMaster();
goto mainmenu;
case 4:
lastscreen();
exit(0);
}
getch();
}
59
*************************************************************
PROJECT REPORT ON PAYROLL
*************************************************************
1.Grade Master
2.Employee Master
3.Payslip Master
4.Exit
***********************************************************
**
60
***************************************************
1.New Grade
2.View
3.Exit
***************************************************
61
GRADE ENTERIES
*************************************************************
GRADE ID A
HRA 5
TA 4
DA 3
PF 2
62
EMPLOYEE GRADE
*************************************************************
A 5 4 3 5 100
B 4 5 6 3 150
D 5 3 2 1 100
A 5 4 3 2 100
B 4 2 3 5 150
*************************************************************
63
EMPLOYEE RECORD
*************************************************************
code: 1
name: ankit
add: knl
basic: 5600
Id: a
*************************************************************
64
*************************************************************
1.NEW
2.VIEW
3.MODIFY
4.DELETE
5.EXIT
*************************************************************
65
*************************************************************
1.Issue of Slip
2.Search of Payslip
3.Prev.Menu
Enter month 12
Already Issued
*************************************************************
66
CONCLSIONS
system is as follow:
Easy to maintain.
67
DISADVANTAGES OF THE
PROPOSED SYSTEM
evaluate the system after a certain period to find out how well the system
is meeting the objectives originally set forth. This would lead to wastage
68
FUTURE SCOPE OF THE PROJECT
Increase accuracy.
69