Anda di halaman 1dari 69

COMPUTERIZED

PAYROLL SYSTEM

KURUKSHETRA
UNIVERSITY,
KURUKSHETRA

1
A PROJECT REPORT ON
COMPUTERIZED
PAYROLL SYSTEM

SUBMITTED TO

KURUKSHETRA UNIVERSITY KURUKSHETRA


IN PARTIAL FULLFILLMENT OF THE
REQUIREMENTS FOR THE
BCA FINAL YEAR PROJECT.

PREPARED BY: UNDER THE SUPERVISION OF:


PRIYANKA RANI MONICA
BCA-III Doon valley College Karnal
University Roll N680155

2
KURUKSHETRA
UNIVERSITY

CERTIFICATE

This is to certify that project report entitled” COMPUTERIZED


PAYROLL SYSTEM “ has been completed under my supervision. The Roll
Number of Student is 680155 of BCA Final Year Kurukshetra University,
Kurukshetra.

It is further certified that the work done in report is a candidate’s


effort. I wish for the best of his future.

Supervisor :

K.U.,Kurukshetra

3
ACKNOWLEDGMENT

I express my sincere and deep sense of gratitude to my guide on this


voyage of project development. I want to express my heartfelt reverence for
his matured guidance, constant encouragement, and development of this
project.

Lecturar in Computer Sc., Doon Valley College, Karnal helped me in a way


that I found developing this project quite adventurous and interesting.

In last, it is my great pleasure to acknowledge gratefully the debt of


all of my friends and other people who directly or indirectly helped me in the
completion of this project.

4
BCA-III
Kurushetra University
University Roll No: 680155

CONTENTS
 Requirements.

 System Analysis and design~

Introduction.
System Development Life Cycle.
System Life Cycle Activities.

Information Gathering~
Information About Firm.
Information About Staff.
Information About Work Flow.

Information Gathering Tools~


On-Site Observation.

 Feasibility Study.

 System Design~

Logical Design.
Physical Design.
Input Design.
Output Design.

 Analysis.

5
 Implementation.

 Post Implementation & Maintenance.

 Language Selected - C++ ~

Introduction.
What is C++?
What is Object-Oriented Paradigm
Basic Concept Of OOP.
Application Of C++.

 Coding Of a Proposed System.

 Output.

 Conclusions~

Advantages Of a Proposed System.


Disadvantages Of a Proposed System.

 Utility of the project.

 Future Scope Of the Project.

 References.

6
REQUIREMENTS FOR RUNNING
THE PROJECT

 SOFTWARE: C++, Windows 98

 RAM: MINIMUM OF

 DISPLAY TYPE: MONO, COLORED PREFERRED

 DISK SPACE: 5-10 MB OS DISKSPACE

 PRINTER: ANY

7
8
INTRODUCTION

System analysis and Design, as the name specifies is related with

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

are going to explain the development of our system.

9
SYSTEM DEVELOPMENT LIFE CYCLE

Developing a system expedites problem solving and improves the

quality of decision-making. This is where the role of system analyst

becomes crucial. They are confronted with the challenging task of creating

new system and planning major changes in the organization.

To understand system development, we need top recognize that a

candidate system has a life cycle. It has to go through various stages. The

analyst must progress from one stage to another methodically, answering

key questions and achieving the results in each stage.

A word of caution regarding life cycle activities: We isolate and

sequence these activities for learning purposes, but in real life they overlap

and are highly interrelated.

10
SYSTEM LIFE CYCLE ACTIVITIES
The different activities that constitute the life cycle of the system

must be logical, relational, valid and relevant to the system. It should be

noted that the activities are highly related usually inseparable.

Many times even the order of steps will be difficult to determine. In

general the six activities that form the life cycle of the system are given

below:-

 Recognition Of Need.

 Feasibility Study.

 Analysis.

 Design.

 Implementation.

 Post Implementation & maintenance.

11
INFORMATION GATHERING

Information gathering is an art and science. The approach and manner

in which is gathered requires sensitivity, common sense and knowledge of

what and when to gather.

The kind of information we needed for our system was about the user staff.

 Information About The Firm.

 Information About The Staff.

 Information About The Work Flow.

12
INFORMATION ABOUT THE FIRM

The information about the organization policies, goal, objectives and

the structure explains the kind of environment that promotes the introduction

Computer based system. Company policies are guidelines that determines.

The conduct of business. Policies are translated in to rules and procedures

for achieving goals.

A statement of goal describes management commitment to objective

and the direction system development will follow objectives and milestones

of accomplishment toward achieving goals. Information from employee

manuals, orientation pamphlets. Annual company report and the like help an

analyst form opinion about the goals of the organization.

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

requirements, and the relationships of their jobs to the existing system.

For our system of COMPTERIZED PAYROLL SYSTEM,

we actually focused on people roles, authority relationships, job status and

functions, information requirements and interpersonal relationships.

Gathering the information of this kind established a basis for determining the

importance of the existing system for the organization.

14
INFORMATION ABOUT WORK FLOW

Work Flow focuses on what happens to the data through various point

in a system. This can be shown by a date flow diagram or a system

flowcharts. A flowcharts represents the information generated at each

processing point in the system and the direction it takes from source to

destination.

A system flowchart describes the physical system. The information

available from such charts explains the procedure used for performing task

and work schedules.

15
INFORMATION GATHERING TOOL USED

ON-SITE OBSERVATIONS:

On-Site observation is the process of recognizing and noting people,

objects and occurrences to obtain the information the organization or the

present system.

The major objective is to get as close as possible to the “real system”

being studied. For this, it is important to have the knowledge of the general

makeup and activities of the system.

However, in our case, through the on-site observations the answers to

the following questions were served :

 What kind of system is the present system ?


Ans.: Manual

 Who handles the system ?


Ans.: The employee

 How does he make all transactions ?


Ans.: By hand

 How does he keep the track various transactions ?


Ans.: By simply checking the record register and then searching.

16
RECOGNITION OF NEED

One must know what the problem is before it can be solved. The

basis for a candidate system is recognition of a need for improving an

information system or a procedure.

In our system of COMPTERIZED PAYROLL SYSTEM,

report we first work out on the problem i.e. we first face the question of need

“Why it is required?” And our answer is to make information storage and

accessibility simpler.

17
FEASIBILITY STUDY
While developing a computer system, the main objective of

feasibility study is to test the technical, social and economic feasibility.

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

viewpoint and if it is technically feasible then we must test for economic

feasibility.

ASSESSING TECHNICAL FEASIBILITY

The includes requirement in terms of input, output, files,

programs, procedures and tools for storing and handling date. It includes

two main consideration.

 SOFTWARE REQUIREMENT

In order to execute my system program, we need C++ complier.

 HARWARE REQUIREMENT

Hardware requirement is PC-XT, PC-AT.

18
ASSESSING ECONOMIC FEASIBILITY

A proposed of developing system must be justified by cost and

benefit criteria so that effort in concentrated on projects, which will give

the best return at the earliest opportunity. The cost benefits analysis is

generally used as a basis for assessing the economic feasibility.

The Factors For Evaluation Are As Follow:

 Cost of operation of the existing and proposed system.

 Cost of development of the proposed system

 Value of benefits of the proposed system. In assessing economic

feasibility our efforts should be to increase profit and reduce

expenditure and improve the quality of a service or goods, which can

provide increased profits. The computerization of distribution system

can be considered as search of economic within expensive technology

lot of paper work is done manually which is very costly.

 ASSESSING SOCIAL FEASIBILITY: The various affected people

must be considered. Its impression on organization structure, group

19
relationship, salary and job should be considered.

The proposed package enables to improve system efficiency

through quick transactions.


SYSTEM DESIGN

So far in our project,

 User requirements have been identified.

 Information has been gathered to verify the problem and evaluate the
existing system.

 The features and reasons behind the new (proposed) system make
sense.

At this point, we began with the design phase of the system….

System design is a solution, a ‘how to’ approach to the creation of

a new system. It translates system requirements into ways of

operationalizing them. It is a translation from a user-oriented document

to a document oriented programmers. For that, it provides the

understanding and procedural details necessary for the implementation.

20
LOGICAL DESIGN

Our logical design covers the following:

 Reviewed the current physical system.

 Prepared output specifications , i.e., it determines the format, contents

of the output functions.

 Prepared input specifications, i.e., it determines the format contents

and most of the input functions. It includes the flow of document from

input data source to actual input location.

 Preparation of edit and security specifications. This includes the rules

for edit corrections and controls that ensure processing.

 Specifies the implementation plan.

21
PHYSICAL DESIGN

Following the logical design, is the physical design:

The physical design produced the working system by defining the

design specification that told us (as a programmer) exactly what the

proposed system must do. In turn, we wrote the necessary program that:

 Accept input from the user.

 Performs the necessary calculations through the existing files

 Produces (displays) the report on the screen.

 Maintains and update the database at all times.

The physical design of the COMPTERIZED PAYROLL SYSTEM, is a program


written in C++. The program has been designed in

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

a computer-based format. In system design phase, the expanded data flow

diagrams identify logical data flows, data stores, sources and destination.

Input data are collected and organized into groups of similar data using

an appropriate input media.

INPUT DATA:

The goal here is to make entry as easy, logical and free from errors

as possible.

The Input Device used here is the keyboard.

The Method of Data Capture and Entry is Online Data Entry.

Online data entry makes use of a processor that accepts commands

and data from the operator through the keyboard. The processor analyzes

the input received. It is then accepted or rejected or further input is

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

information to the user. The major form of output of our program is

displayed on the CRT screen. The output can be obtained as hard copy

from the printer. Printouts should be designed around the output

requirement of the user. The output device to consider depends on factor

such as compatibility of the device with the system, response, time ,

requirement, expected print quality and number of copies needed.

The following media device is available for providing


computer-based output:

 MICR Readers.

 Line, Matrix and Daisy Wheel Printer.

 Computer Output Microfilm(COM).

 CRT Screen Display.

 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,

through difficulty is important in managing operations. Developing a new

system is no acceptation Analysis is a detailed study of the various

performed by system an their relationships with in and outside of the


system.

Its includes: -

 Detailed evaluation of the present system:-

This was the first step to work on a Project i.e.

analyze the present system. As according to my project of Payroll system

we observe many problems in an institute when no. of employees were

working an their records maintained in the file system which has a large

reposting of data. It observe no. of problems facing by the institute at the

end of the month. When the period of their salary started. We observe all

these problems one by one and quires from employees of institute,

25
whether they are satisfied or not, but the response was negative. They

have to face no. of problems such as time consuming, number of well

defined records are maintained, some time get late and may be incorrect.

So it was concluded to manipulate this manually payroll system to

computerized Payroll System after getting observing the present system

of the Payroll system.

 Data Collection:-
This was the second step in which I concern with

managers and other employee’s having the duty to prepare

payroll’s of all the employee. I collected the data of all the

employee one by one and form the designing of the modules,

which I must be added to prepare that project. For that I have

prepared three modules:-

 One module having only the basic details of the

employee

 Second module to calculate the Net salary of the

employee

 Third module to issue the slips and having the

reports about each employee whether pay is issued

or not him/her.

26
This was the one of the time consuming process but I succeeded

because all of us was working as a unit.


IMPLEMENTATION
The implementation phase is less creative than system design. It is

primarily concerned with user training, site preparation and file

conversion. When the candidate system is linked to terminals or remote

sites, the telecommunication network and tests of the network along with

the system is also included under implementation.

Our COMPTERIZED PAYROLL SYSTEM, report is easy to

implement. This is because there is not many file conversions. User

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

adjusted to the changes made by the candidate system, evaluation and

maintenance begins. Like any system there is an aging process that

requires periodic maintenance of hardware and software. If new

information is consistent with the design specifications, then changes

have to be made. Hardware also requires periodic maintenance to keeping

tune with design specifications.

Our system of COMPTERIZED PAYROLL SYSTEM, report is

simple to maintain. This is because there is no complexity

in the program. It is only a simple C++ program. Hardware requirement is

general as in other systems.

28
29
INTRODUCTION TO C++

C++ is an extension of C language, which is widely used all over. It is

a powerful modern language that combines the power, elegance and

flexibility of C and the feature of Object Oriented Programming (OOP).

It is faster and more powerful than java, another poplar object

oriented language, which lacks certain features like pointers and multiple

inheritance. With its object oriented capabilities, such as data abstraction.

Inheritance and polymorphism, C++ offers significant software

engineering benefits over programming language. Programming pundits

except that C++ will replace C as a general purpose programming language

in the near future. C++ is the language of the future.

30
HISTORY OF C++
C++ is an object-oriented language. It was developed Bjarne

Stroustrup at AT&T Bell Laboratories in Murray Hill, New Jersey, USA, in

the early 1980’s. Stroustrp, an admirer of Simula 67 and a strong supporter

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

and elegance of C. The result was C++. Therefore, C++ is an extension of C

with major addition of the class construct feature of Simula 67. Since the

class was a major addition to the original C language. Stroustrup initially

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

++, thereby, suggesting that C++ is an augmented (incremented) version of

C.

During the early 1990’s, the language underwent a number of

improvements and changes. In November 1997, the ANSI/ISO standards

committee standardized these changes an added several new features to the

language specification.

31
WHAT IS OOP?
The major motivating factor in the invention of object-oriented

approach is to remove some of the flaws encountered in the procedural

approach. OOP treats data as a critical element in the program

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

from accidental modification from outside functions. It allows

decomposition of problems into a number of entities called Objects and

then builds data and functions around these objects. The organization of

data and functions in OOP are shown below: -

STRIKING FEATURES OF OOP

 Emphasis on data rather than procedure.

 Programs are divided into objects.

 Data Structures are designed such as they characterize the objects.

 Functions that operate on the data of an object are tied together in


the data structure.

 Data is hidden and cannot be accessed by external functions.

 Objects may communicate with each other through functions.

32
 New data and functions can be easily added wherever necessary.

 Follows bottom p approach in program design.


BASIC CONCEPTS IN OOP

 OBJECTS: -

Are the basic runtime entities in object-oriented system? They

may represent a person, a place, a bank account, a table of data or any

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

objects interact by communicating with each other. Each object

contains data and code for manipulation.

 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,

we can create any number of objects belonging to that class. Each

object is associated with the data of type class with which they are

created. A class is thus a collection of objects of similar type. For

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: -

The wrapping up of data & functions into a single unit (called

class) is known an Encapsulation. It is the most striking feature of a

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

program. This insulation of data from direct access by the program is

called Data Hiding or Information- Hiding. Abstraction refers to the

act of representing essential features without including the

background details. Classes use the concept of abstraction and are

defined as list of abstract attributes, such as size, weight, cost and

function. Functions that operate on these data are called ‘methods’ or

‘member functions’.

 INHERITANCE: -

It is the process by which objects of one class can acquire the

properties of another class. It supports the concept of hierarchical

classification. For example ‘scooter’ is a part of ‘2-wheelers’, which is

again a part of ‘vehicles’. The principle behind this sort of division is

34
that each derived class shares common characteristics with the class

from which it is derived.

 POLYMORPHISM:-

It means the ability to take more than one forms. An operation

may exhibit different behavior in different instances that which

depends upon the type of data use in the operation. For example

Consider ‘+’ operator. For two numbers it will generate the sum, but

for two strings, it will concatenate them.

 DYNAMIC BINDING: -

It refers to the linking of the procedure call to the code to be

executed in response to the call. It mans that the code associated with

polymorphism and inheritance.

 MESSAGE PASSING:-

An OO program consists of a set of object that communicate

with each other. The process of programming in an OO language,

therefore, involves:

 Creating classes that define objects and their behavior.

 Creating objects from class definitions.

 Establishing communication among objects.

35
APPLICATION OF C++
C++ is a versatile language for handling very large programs. It is

suitable for virtually any programming task including editors, compliers,

data base system, communication system an any complex real life

application systems.

 C++ allows s to create hierarchy related objects. So we can build


special object oriented libraries, which can be used later by many
programmers.

 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.

 C++ programs are easily maintainable and expandable.

 It is expected that C++ will replace C as a general-purpose


language in the near future.

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()
{

cout<<"\n\n\t"<<grade_id<<"\t "<<hra<<"\t "<<ta<<"\t "<<da<<"\t


"<<pf<<"\t "<<proff_tax;
}
//**********************************************************
******************

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<<"=";

cout<<"\n1.View All\n2.View By Name\n3.View by Id\n4.View Net


Salary\n5.Exit";

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

//***********************MODIFY THE RECORD BY


CODE***************************
void employee::modifycode()
{
char ch;
int code;
cout<<"\nEnter Employee Code....";
cin>>code;
ifstream fout("employee",ios::in);
ofstream fin("tempemp",ios::out);
if(fout!=NULL)
{
fout.seekg(0);
while(fout.read((char*)this,sizeof(*this))!=NULL)

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

//****************** FUNCTION TO DELETE THRE RECORD


*******************

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(&current_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();

cout<<"\n1.Issue of Slip\n2.Search of Payslip\n3.Prev.Menu";


cout<<"\n\n\tEnter your choice....";
cin>>choice;
switch(choice)
{
case 1:
p.issue();
getch();
goto payslipmenu;
case 2:
cout<<"\n\nEnter the Employee Code:.....";
cin>>ecode;
cout<<"\nEnter Month:.......";
cin>>m;
cout<<"\nEnter Year: ........";
cin>>y;
p.readtofile(ecode,m,y);
getch();
goto payslipmenu;

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

***********************************************************
**

Enter your choice....1

60
***************************************************

1.New Grade

2.View

3.Exit

***************************************************

Enter your choice...1

61
GRADE ENTERIES
*************************************************************

GRADE ID A

HRA 5

TA 4

DA 3

PF 2

PROFESSIONAL TAX 100


*************************************************************

62
EMPLOYEE GRADE
*************************************************************

GRADE ID HRA TA DA PF PROFESSIONAL TAX

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
*************************************************************

Enter your choice...4

Enter the employee code to delete the record 3

Are u sure to delete the record y

65
*************************************************************

1.Issue of Slip

2.Search of Payslip

3.Prev.Menu

Enter your choice....1

Enter month 12

Enter Year 2004

Already Issued

*************************************************************

66
CONCLSIONS

ADVANTAGES OF THE PROPOSED SYSTEM:

The benefits that are contributed by the proposed computer based

system is as follow:

 Provide Maintenance Of Records.

 Make access to data easy for users.

 Provide response to the users request for data and information.

 Since everything is done using computers, a lot of human effort is


saved.

 Easy to maintain.

67
DISADVANTAGES OF THE
PROPOSED SYSTEM

The only disadvantage of the system would be that this system

would require evaluation after implementation. We world have to

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

of time, money and require some improvements included.

68
FUTURE SCOPE OF THE PROJECT

This project is aimed to improve organization effectiveness. It has a far-


reaching impact on the entire organization. The implementation of the
project will affect more the established method and procedures .

This system can enhance the productivity by:

 optimizing the output of the system.

 helping in routine work functions.

 Increase accuracy.

 Reducing normal errors.

 Effective management of time and resources.

69

Anda mungkin juga menyukai