You are on page 1of 2

Payroll Management System

Learning Objectives
The designing of the Payroll Management System helps the students to:
Create C++ classes with data members and member functions.
Generate and call member functions and static functions.
Use the structure struct date of dos.h file and its main functions.
Develop and display main menu and its sub-menus.
Read and write randomly to binary files.
Use the setw function.
Understanding the Payroll Management System
The Payroll Management System project is an application that allows you to perfo
rm different operations such as adding employee information, accessing employee
information and generating a salary slip. This application contains two section
employee and payroll. The employee section helps to add, update, delete and acce
ss information related to an employee. The payroll section helps to generate and
display payroll and display salary slip. The initial screen of the Payroll Mana
gement System accepts a username and password to validate a user of the Payroll
Management System. If a user enters a wrong username and password three times th
en the application quits or else the main menu of the Payroll Management System
appears. Main menu of the Payroll Management System contains three options Emplo
yee Section, Payroll Section and Quit. The Employee section option of the main m
enu takes the user to the employee section of the Payroll Management System. The
Payroll Section option allows a user to access the Payroll section of the appli
cation. The Quit option allows a user to exit the application. The following fi
gure shows the main menu of the Payroll Management System application:
A user can enter an integer such as 1, 2 or 3 to make a choice from main menu op
tions.
Developing the Payroll Management System
To develop the Payroll Management System application, you need to create two cla
sses, employee and payroll. The employee class helps perform operations such as
adding and deleting employee information. The payroll class helps perform operat
ions such as generating and updating the payroll for an employee. Both the class
es contain member functions and variables and also help perform validation on al
l data values entered by a user of the Payroll Management System.
Creating the employee class
You need to create the employee class to perform different tasks related to an e
mployee. These tasks are:
Adding employee information to employee.dat data file.
Updating employee information in employee.dat data file.
Deleting employee information from employee.dat file.
Displaying all information related to an employee from employee.dat file.
Displaying information of a single employee from employee.dat file
Checking whether an employee code exists or not in the employee.dat file.
Retrieving the salary of a particular employee from employee.dat file.
Validating all data related to an employee when a user is entering the employee
data.
To perform the above tasks, employee class implements the following member funct
ions:
Functions
Description
add_employee
Adds information related to an employee to the employee.dat data
file.
update_employee Updates the information related to an employee in the employee.d
at data file on the basis of the employee code.

delete_employee Deletes the information related to an employee from the employee


.dat file on the basis of employee code.
check_empcode Verifies whether an employee code exists in the employee.dat dat
a file. The check_empcode member function is a friend function.
show_employee Displays the information related to an employee on the basis of
the employee code from the employee.dat file.
show_employees Displays the information of all the employees from the employee.
dat file.
get_salary
Returns the salary of an employee on the basis of specified empl
oyee code.
You can create the employee class by defining the member functions and variables
, which are required to manage the employee data.
Creating the payroll class
You need to create the payroll
l. These tasks are:
Generating payroll
Updating payroll
Displaying Salary slip
Displaying all payroll
Checking employee code
Validating all payroll

class in order to perform tasks related to payrol

details
for existence
data

To perform the above tasks payroll class implements the following member functio
ns:
Functions
Description
generate_payroll
Generates payroll by retrieving information related to s
alary from the employee.dat data file and saves the information related to payro
ll in payroll.dat file after validation.
update_payroll Updates the information related to payroll in the payroll.dat da
ta file
salary_slip
Displays the salary slip of a particular employee using the info
rmation stored in employee.dat and payroll.dat files.
all_payroll
Displays the information related to all payrolls from the payrol
l.dat file.
You can create the payroll class by defining the variables that are required to
perform tasks such as generating the salary slip and updating payroll. To create
the payroll class you also need to define the member functions such as all_payr
oll and generate_payroll.

You might also like