Vous êtes sur la page 1sur 64

CHAPTER ONE

1.0 INTRODUCTION
1.1 BACKGROUND OF STUDY
Prompt payment of staff salaries by management of on organization boosts the
morale of staffs and enhances productivity. Manual preparation of staffs salaries is
often associated with lots of problems, which often time disrupt the morale of
workers. The problems ranges from arithmetic error in computation, delay in
payment. Underpayment or overpayment and so on. In this project work,
automated system shall be developed which shall eliminate all the problems
associated with the manual process.
The most common method of keeping the financial records of a company was
manually. A bookkeeper keep the journals, the accounts receivable, the accounts
payable, payroll and the ledgers in his best possible penmanship. In bier years, an
accounting machine. Which was capable of performing normal bookkeeping
functions, such as tabulating in vertical columns, performing arithmetic functions,
and typing horizontal rows was used. The billing machine, which was designed to
typewrite names, addresses, and descriptions, to multiply, to compute discounts,
and to add net total, posting the requisite data to the proper accounts, and so to
prepare a customers bill automatically once the operator has entered the necessary
information, was used. Early accounting machines were marvels of mechanical
complexity. Often combining a typewriter and various kinds of calculator
elements. The refinements in speed and capacity made possible by advances in
electronics and operating complexity of these machines, Many of the newer
Generations of accounting machines are operated by computer to which they are
permanently connected. Because of the minute by minute change in finances,
1

accurate record keeping is critical. Automating a businesss general ledger, payroll,


and other accounting tasks increases office efficiency.
With the advent of atomization in accounting, electronic spreadsheets were used to
compute payroll and perform other accounting routines in organizations. Electronic
spreadsheets allow you to do anything that you would normally do with a
calculator, pencil and columnar scratch pad. Spreadsheets were primarily designed
for managers who in the process of planning must do what if calculations and
due to their flexibility; electronic spreadsheets have found their way into
businesses. It takes its name from the accountants spreadsheet a sheet of paper
with rules for rows and columns-on which such work was usually done.
Spreadsheet programs are much faster, more accurate, and easier to use than
traditional accounting techniques. An example of electronic spreadsheet is
Microsoft Excel.
Early programs such as VisiCalc provided 254 rows and 63 columns for entering
data and formulas for calculations. VisiCalc was introduced by Robert Frankston, a
young computer programmer, and flan Dan Bricklin, a Harvard Business Section
student who was looking for a way to use the power of a computer to simplify
complex time-consuming financial analyses. VisiCalc proved so useful n such
applications that it provided an entry for personal computers into the business
world. In 1980, the Soreim Corporation introduced SuperCalc, a similar
spreadsheet program for personal computers using the CPM operating system.
Some modern programs (or computers with large memories provide thousands of
rows and hundreds of columns.
A new generation of computer software for business began with integrated
spreadsheet programs, which can be used to prepare spreadsheets, create graphs,
and manage data. In such programs, for example, it is easy to display spreadsheet
2

data in the form of a graph or to transfer data from a data base to a spreadsheet.
One of the first such programs was Lotus 1-2-3, art immediate success following
its introduction in 1983.
1.2 STATEMENT OF RESEARCH PROBLEM
Preparation of payroll manually as earlier said is a cumbersome and boring task
encountered by the account personnel in an account department to the calculations
involved and its repetitive nature. After an extensive interview with the account
personnel on the existing payroll system, I discovered the following problems
within the system:
Calculating salaries through manual operation is burdensome and stressful.
Errors such as transposition of figures in the journal
Overpayment/Underpayment of salaries
Delay in payment of staff salaries because too much time is spent in
preparation of the payroll.
The use of paper to keep pay details about each employee which results in
loo much paper work.
There is less security in the manual system.
1.3 AIMS AND OBJECTIVES
The aim and objective of the project is to primarily automate the existing system.
The specific objective are:
Offer access control to the payroll system;
3

Avoid errors in the preparation of the payroll;


Ensure prompt payment of accurate salaries;
Reduce the administration time and overhead of personnel in the account
section;
Reduce the use of paper in record keeping;
Keep records of employees secure:
Make necessary information available to employees;
Offer update and processing control to the payroll system; and
Improve the working efficiency of the employees.
1.4 RESEARCH METHODOLOGY
This project work will be implemented in C++ programming language. Microsoft
Access will be used to keep the database of the organization and employees bio
data, Unified Modeling Language (UML) will be used to model diagrams.
1.5 SIGNIFICANCE OF THE STUDY
Organizations which have very few employees may calculate payroll manually and
find it less cumbersome and accurate hut larger business organizations find it
boring and cumbersome going through the same process due to the required record
keeping and repetitive nature of the calculations involved in payroll.
Due to large number of employers in some organization it has been discovered that
calculating the payroll by manual process can be more prone to errors, inaccurate
4

and burdensome. Also, it has been discovered that the development and use of an
application is more cost effective than the manual system.
Therefore a secured application that will improve on the way employees are being
paid shall be developed.
1.6 SCOPE /LIMITATION OF STUDY
The scope of the study is limited to only atomization of payroll system for a wellorganized organization

CHARTER TWO
2.0 LITERATURE REVIEW
2.1 MEANING AND PURPOSE OF PAYROLL
Payroll according to David Weaver et al (2009) is referred to as the total earnings
of all employees for a certain pay period. It is one of a series of accounting
transactions dealing with the process of paying employees for services rendered,
after processing of the various requirements for withholding of money from the
employee for payment of payroll taxes, insurance premiums, employee benefits
and other deductions Payroll, (Wikipedia the free encyclopedia.htm.2010).
Payroll involves the calculation of amounts due the employee, such as hourly
wages, a salary consisting of a certain amount per calendar period, or pa to
salespersons on commission. In addition to these payments, there are often
computed amounts of paid vacation time and accrued sick lease which have been
used or are available for use. All of these monies credited to the employee arc
usually referred to as gross pay. From these amounts that are credited to the
employee, various debits are taken as withholding, the most significant being
income tax, then other taxes such as security. There may also be additional
deductions for health insurance, union dues, pension plan contributions, repayment
of prior salary, vacation or sick leave overpayments made in error and other
deductions. The amount left after deductions from gross pay is generally the
amount given in the employees pay envelope, either as cash or a cheque. This
amount is known as net pay. If the employee has their net pay deposited to their
6

bank account (through a process known as direct deposit) then the employee may
simply receive a pay stub indicating this.
The purpose of payroll is to calculate pay due employees, to print paychecks and to
maintain cumulative earnings records of all employees.
Generally, there are three main computations in the payroll namely:
Gross Earning
Deductions
Net Pay.
2.1.1 AUTOMATION OF PAYROLL EARNINGS
The amount an employee earns is known as the gross earnings. Various plans such
as the salary plan, hourly rate plan, incentive pay plan, are used to determine an
employees gross earnings.
A payroll deduction is an amount subtracted from gross earnings. Payroll
deductions include deductions required by law, such as the federal income tax,
state income tax, and social security tax. They may also include voluntary
deductions, such as the life insurance and hospitalization insurance premiums. In
addition, some union contracts call for union deductions such as initiation fees and
dues to be withheld from the employees earnings. The remainder after subtracting
all deductions is known as net pay. Net pay is the amount actually given to the
employee and it is commonly referred to as the take home pay.
Gross Wages

****

Less: Deductions
7

Taxes

****

Union Dues ****


Loan

****

Total Deductions

****

Net Pay

****

2.1.2 THE PAYROLL PROCESS


According to David H. Weaver et aI (2009), preparing the payroll involves the
following
steps:
1. Journalizing the payroll
2. Posting to the employee earnings records
3. Posting to the general ledger accounts
4. Recording and posting payroll taxes
5. Recording and posting payment of the payroll.
1. Journalizing the Payroll
The payroll journal is a special journal used to record payroll data for each pay
period. The payroll data for each pay period for all employees is recorded in the
payroll journal. After the data for each employee is entered in the payroll journal,
the payroll is then proved by adding and subtracting the columns.
2. Posting to the Employee Earnings Records
8

After the payroll journal is totaled and proved, the payroll information from the
payroll journal are posted to the employee earnings records. An employee earnings
record shows the details of an employees earnings and deductions for the year.

3. Posting to the General Ledger Account


The totals of the payroll journal provide the data for posting the payroll to the
ledger account,
4. Recording and Posting Payroll Taxes
The federal and state laws require employees as well as employers to pay payroll
taxes.
The payroll taxes are also posted in the general ledger.
5. Recording a Payment or the Payroll
The records of salaries and wages that an employer must keep arc called payroll
records.
These records must provide several types of payroll data, including the following:
The amount of wages and salaries paid to the employees
The amount deducted from employees earnings
The classification of wage and salary expenses
The payroll taxes owed by the employer and the employees to the
government agencies.
9

When salaries are paid, the total amount of all the payroll cheques is entered in the
cash payments journal. The amounts are then posted from the journal to the ledger
account.

2.1.3 METHODS OF PAYING EMPLOYEES


The method for paying employees depends on whether an organization chooses to
pay their employees by cash, bank transfer, or cheque. Paying by cash involve the
payroll being paid in cash. Some organizations pay their employees by bank
transfer. A bank transfer is a method of transferring Funds from one account to one
or more other accounts. In this method, the employer gives the bank a cheque for
the total net pay and a list showing the net pay for each employee. Paying by
cheque provides the employer with cancelled checks as proof that the employees
has e been paid, It also avoids having a large amount of cash on hand on paydays
and sorting the cash into individual pay envelops.
Some employers use a voucher cheque for paying its employees. A voucher cheque
consists of two parts, one of which is a cheque. The lower part of voucher cheque
is a regular cheque. The upper (or voucher part) is the employee pay statement and
is kept by the employee as a record of gross earnings, deductions and net pay for
the pay period.
2.2 AUTOMATED PAYROLL SYSTEM
Automating a payroll system can be beneficial to an organization because it
reduces time required for payroll work since payroll work requires performing
wide range of activities that involves a great deal of time in recording information,
preparing forms, and making calculations. An Automated payroll calculates and
10

tracks employee salaries, wages, bonuses, tax withholdings, and deductions. It


prints employee paychecks, provides reports to better manage employee pay
records, and generates complete weekly, Monthly, quarterly, and annual payroll
tax-related forms and reports. Automated payroll can assure business accurately
withholds taxes from employees and pass mandatory fees such as Workers
Compensation, once the initial information is input into the system. It is also used
in automating and providing timely and accurate payroll processing for all types of
employees. The Automated payroll is designed to process all types of payroll
transactions for the purpose of computing and paying employees hence,
atomization makes generating payroll a much simpler and quicker process than if
trying to perform these duties manually.
2.2.1 FUNCTIONS OF AUTOMATED PAYROLL SYSTEM
Some of the functions commonly handled by payroll software include:
Pay employees for work performed
Print payroll checks.
Provide a structured system of general guidelines for your organization,
including employee pay structure, pay frequency, and overtime definitions
Distribute wages and salaries to spec ilk general ledger accounts.
Store relevant information on each employee, such as contact information,
start date, and wage and payment history.
2.2.2 THE ADVANTAGES OF AUTOMATED PAYROLL SYSTEM

11

Some of the advantages of payroll system are undoubted speed and accuracy.
Automated Payroll ensures accurate payment of employees pay and government
taxes.
It also holds many benefits for organization apart from time saving and accuracy
already mentioned, other advantages include:
Reduced administration lime by automating payroll calculation and printing
of paychecks
Eliminated tax penalties for inaccurate returns or late payments of amounts
withheld
Improved payroll accuracy with automatic tax and deduction calculations
Easily compensate employees for work performed
Improved organization with consolidation of all payroll related records and
reports
Increased speed in adjusting to regulations by receiving periodic updates and
effortlessly produce the required governmental reporting
Eliminated paper check security issues with direct-deposit capability
Increased accuracy of tracking payroll expenses to the proper general ledger
account or customer job
Reduction of administrative overhead
Automation of many manual processes
12

Provides timely payroll processing


2.2.3 CONTROLS FOR AUTOMATED PAYROLL SYSTEMS.
Automated accounting system must have the same basic controls as manual
accounting systems in order to ensure accuracy, honesty, efficiency and speed.
However, automated accounting systems also require special controls. This is
because one major disadvantage to Automated accounting systems is that there is a
greater possibility for fraud and dishonesty than with a manual system (David H.
Weaver et al. 2009).
Some of the controls that organizations use to ensure that automated records arc
not tampered with, whether accidentally or for dishonest PUPOSCS includes:
Organizational controls: when a business sets up an automated system, it can
organize the system in such a way to ensure maximum controls. For example,
computer equipments should he kept in a separate room that can he kicked. Only
employees who are authorized to use the system and the equipment should be
allowed into the room.
Another control is dividing responsibility for the tasks required by the system
among a number of employees. For example, the person who designs the system or
the procedures to be followed, the people who operate the computers and the
people in charge of the disks or tapes on which programs or back-ups are stored
should all work separately from each other.
Program controls: certain controls can be built into the program itself. For
example some programs require that a password is entered into the system before
access can be made to the program. This is usually a code that prevents others horn
having access to the work that is being done. Password is a special word or
13

combination of letters or numbers. Passwords are used to protect confidential files


or information. An example of a password is the personal identification number
(PIN), user login identification and authentication.
An error report is a control in which computer is instructed not to process
something. For example, the computer can he instructed not to write a check for
more than one hundred thousand naira. If a check request for one hundred and
twenty thousand naira is possessed, the computer will nut issue the check.
However, it will issue an error report, and refer the request to management. This
report alerts management to possible unauthorized attempts to use the program.
An item count is a control in which the software is programmed to allow a
specified number of items lo be processed. For example, in processing payroll
checks, the computer can be instructed lo print out only a certain number of
checks. As each is printed, a count is made. If the number of checks requested is
different than the number of employees, the program issues an alert.
Application control: Application controls prevent or detect errors and
irregularities in an application system. They do this during input of data, during
processing of data by computer, and with outputs from processing.
Application controls in the payroll system is illustrated below:
Input: Completeness test ensures that program verifies the existence of employee
name and identification number.
Processing: Record count ensures that the program verities the number of input
transaction records is equal to the number of output transaction records.
Output: Record count ensures the program verifies that the total amount of
paychecks is equal to the number of payroll transaction records, Program also
14

verifies that the total amounts of paychecks is equal to total debits and credits on
general ledger accounts.
2.3 PAYROLL REPORTS
According to J.L Bookholdt (2011). Payroll systems produce three types of report:
the payroll register control reports for pay checks, and various cumulative earnings
reports.
Payroll register: Payroll systems produce a payroll register prior to printing payroll
checks. The register lists all employees for whom paychecks arc due. For each
employee, it shows the gross pay, list all deductions, and show net pay. Producing
the payroll register is an important control practice because a payroll supervisor
will have to review the payroll register for errors before printing the paychecks.
Then a clerk corrects error prior to printing the checks. This avoids printing
erroneous checks that could be stolen and cashed.
Print checks control report: Because paychecks can easily be stolen or falsified,
the system must control their preparation. The print checks control report aids in
detecting missing or unauthorized checks. The computer program that prints
checks also produces this control report showing the number of checks printed and
the total amount of these checks. The data control group compares these control
totals with the checks.
Cumulative earnings report: Employers are required to withhold taxes from
employees paychecks and send these taxes to government. Payroll systems aid in
this process by producing several kinds of cumulative earnings reports, which
summarize the gross pay and tax withheld for an employee.
2.4 REVIEW OF THE EXISTING SYSTEM
15

Manual Payroll systems maintain data in a tilling cabinet about each individual
employee. Payroll clerks then use data in this file to calculate gross pay and to
determine the amount of deductions. They also record in this tile, cumulative
earnings information for individual employees.
Non Automated systems use a journal called payroll register, in which a payroll
clerk record the calculation for gross pay, deductions and net pay.
In the manual system, personnel department screens applicant, authorizes the
employees initial pay rate, and creates the manual employment record and then
sends a copy to the payroll sections. For salaried employees, this record authorizes
a periodic paycheck.
The personnel or administration department completes a series of activities prior to
and at the beginning of employment and forwards the information to the payroll
section. Before the new employee begins work, certain personnel records must be
completed. Generally these records form the basis for deductions that will be made
from the employees gross pay. For a newly employed staff, a letter of appointment
stating grade level and step is given to the new employee and a copy will be
submitted in the personnel department, after which the personnel section. The
personal emolument record shows the name, address, the grade level and step of
the employee, the incremental date and the salary details (Gross pay, deductions
and net pay) every month for each employee for the year.
It is from the personal emolument record that salary details will be entered into the
payment salary voucher. The payment salary voucher contains total of salaries paid
to all employees in all section in the organization, it is also from the payment
salary voucher that payment sups and checks are written out.

16

The payment slip and checks are dispatched to every staff after they are written
out. It is after they have gotten their payment slip and checks that they can go to
the bank to collect their salaries.
All this processing involved in paying salaries are done manually and all records
are stored in files which are eventually stored in a tile cabinet.

All these manual processes have resulted in problems such as:


Missing records
Theft and fraudulent practices
Errors
Wastage of materials and
Lack of adequate information.

17

CHAPTER THREE
3.0 SYSTEM ANALYSIS AND DESIGN
3.1 INTRODUCTION
According to Simon Bennet et al (2012), system analysis is defined as a process of
seeking to understand the organization, investigating its requirements and
modeling them. System analysis can also he referred to as the study of a business
problem domain to recommend improvements and specify the business
requirements for the solution. (Jeffrey .L. Whitten et al. 2010) it is the result of this
analysis activity that gives the specification of what the proposed system will do
based on the requirements.
System analysis is the study of a system and its component as a prerequisite to
system design. It is a problem solving technique that decomposes a system into its
component pieces for the purpose of studying how well those components work
and interact to accomplish their purpose. Contemporarily, System analysis is a term
that collectively describes the early phases of system development. There are many
18

approaches to system analysis and these include structured analysis, information


engineering, discovery Prototyping, and object oriented analysis. For the purpose
of this project, the object oriented analysis will be used for the system analysis and
design.
System analysis is a very important aspect of system development because during
this phase several fundamental decisions are made. During the analysis the system
owner and user are specified because the system analysis is driven by the business
concerns of the system owners and users, system analysis also reveals what the
system would do and it helps the stakeholders knows whether the proposed system
is technically, economically and operationally feasible.
3.2 BRIEF REVIEW OF THE EXISTING SYSTEM
Records and payment details about each employee is kept in a personal emolument
card and payment salary voucher which are stored in files and eventually in a file
cabinet. The harmonized public service salary structure as for coherent workers
and the individual organization salary structure are used to determine the amount to
be paid to employees in the organization and this is based on employees grade
level and step. The net pay for each employee is gotten after subtracting the total
deductions from the gross earnings.
3.3 DESCRIPTION OF PROPOSED AUTOMATED PAYROLL SYSTEM
Details from the personal emolument card and payment salary voucher will be
used to create a database in the automated system to keep the records and payment
details of all employees in all departments of the organization. Automation of each
employees earnings will be based on the provisions made on the harmonized
public service salary structure. In the proposed system three access options will be
provided, where you either login as a staff salary officer or payroll administrator.
19

For the stall, one shill only be able to view Report/paycheque. As a salary officer,
one will be able to compute net pay view and print reports and pay cheques but
won't be able to edit employees records. The payroll administrator will be the only
one who has the access right to edit records, basic salaries and specify percentages
that will he used to compute payments. Staffs, Salary officers and Payroll
Administrator at the login interface will have to enter their username and password
in the text fields as contained in the database. If username and password are valid
for respective users as contained in the database, the system welcomes them and
takes them to the menu interface as related individual users.
For the staffs, the system takes them to the menu where they will be able to view
reports and paycheque while for the salary officer, the system opens the menu
interface where all payroll processes arc contained. In the payroll module, the
salary officer after entering key details about the employee, the program will
automatically call other payments from the database and display the net pay for the
pay period.
The payroll administrator will be grained access to the database where records can
he modified, edited and updated. The output that will be generated from the
proposed system will be the paycheque, staff's report and management report
needed at dil1rent levels. The atomization of the existing system will help to
address problems such as missing records, theft and fraudulent practice, arithmetic
errors, wastage of materials, lack of adequate information, e.t.c n the system.
3.4 SYSTEM DESIGN
System design is the specification or construction of a technical, computer-based
solution for the business requirements identified in a system analysis (Jeffrey .L.
Whitten et al. 2010) System design is concerned with establishing how to deliver
20

the functionality that was specified in analysis while at the same time, meeting
non-functional requirements that may sometimes conflict each other. System
design is focused on making high-level decisions concerning the overall structure
of the system. It also involves establishing protocols and standards for the design
activities. (Simon Bennet et al, 2012).
System design is divided into stages:

Logical (implementation independent): This is concerned with those aspects


of the system that can dc designed without knowledge of the implementation
platform.

Physical (implementation dependent): This is concerned with those aspects


of the system that are dependent on the implementation platform that will he
used.

In the object oriented analysis and design. Unified Modeling Language will he
used to model the system. A model is the act of drawing one or more graphical
representations of a system. Modeling is the process of abstracting and organizing
significant features of part of the real world.
3.5 DATABASE DESIGN AND DESCRIPTION
A database can defined as a body of information held within a computer system
using the facilities of a database management system. (Myrin F.Chester. Avtar k.
Athwall, 2011) A database can also be defined as an organized collection of data.
There are many strategies for organizing data to facilitate easy access and
manipulation. Database management systems allow for access and storage of data
without concern for the internal representation of data. A database management
system provides mechanisms for storing and organizing data in a manner
21

consistent with the databases format. There are several types of database
management systems. They can be classified according to the way they structure
records.
Early database management systems organized records in hierarchies or networks
implemented with indexes and linked list. But today, most successful database
management systems are based on relational technology. (Jeffrey Whitten et al,
2010). A relational database is a logical representation of data that allows data to be
accessed without consideration of the physical structure of the data. A relational
database stores and implements data in a series of two-dimensional tables that are
related to one another via foreign keys. Each table arc sometimes called relation
consists of named columns (fields or attributes) and any number of unnamed rows
(records).
A data manipulation language is used to create, read, update and delete records in
the database and to navigate between different records. The data manipulation
language of most relational database is called SQL. It supports complete database
creation, maintenance, and usage. It also provides basic commands such as
(SELECT FROM, WHERE, INSERT. UPDATE, DELETE, e.t.c) to access data in
tables. The structured query language can be used in two ways: interactively or
embedded inside another program. It is used interactively to directly operate a
database and produce the desired results. The second way to execute a SQL
command is by embedding it in another language such as COBOL, BASIC, Visual
Basic, C or C++. The result of the embedded SQL command is then passed to the
variables in the host program, which in turn will deal with them. This application is
implemented by combining structured query language (SQL) together with a high
level language (C++) which allows the creation of user interfaces and database
access in one application. To design the illustration above, it would commence
22

with the database design which would reveal all the necessary component, entities
and attribute that would be needed throughout the course of our implementation.
The database design includes three major tables which would serve as the basis of
discussion for the requirement of the system. The tables (records) used are listed
below as applied within the program listing. The following shows the payroll
database and its schema:
1.

Personnel (Staff ID, Staff Name. Staff Address. Grade Level, Step. Sex.
Department. Basic Salary Overtime, Transport Allowance. Monthly Tax,
Union Dues. Net pay)

2.

Monthly Basic Salary (Grade Level, Step1, Step2, Step3, Step4, Step5,
Step6Step 15)

3.

Users (User Name .Password, Status)


CHAPTER FOUR

4.0 SYSTEM IMPLEMENTATION


4.1 INTRODUCTION
Implementation is the process by which a system developed as utilized and made
functional or the process of convening a new system design into operation. It is the
delivery of the system into production. This is the phase where all the requirement
analysis and system design is put to test to ensure effective delivery of the system.
4.2 SYSTEM REQUIREMENTS
4.2.1 HARDWARE REQUIREMENT

23

This is the aspect concerned with the physical components of the computer needed
for the effective operation of the new system. The software will run well with
under listed hardware specification:

Intel Pentium III 500 MHz or compatible

512 MB RAM (recommended minimum)

768 MB RAM (recommended)

560-760 MB hard disk space minimum (depending on features installed)

4GB Hard disk( recommended)

A SVGA color monitor with high resonance

A power surge

U.P.S

4.2.2 Software Requirement


This aspect specifies the various events the proposed system would be able to
perform from the user's perspective in order to ensure a good and working system.
The following are the software needed for the smooth running of the package:

JRE(C++ Runtime Environment)

J2SE 1.4,J2EE and J2ME

Microsoft Windows XP, or NT 4.0

Microsoft SQL Server.

4.4 CHOICE OF PROGRAMMING LANGUAGE


24

C++ programming language is used for the implementation of this application and
this is because of its rich features and these include the following among others:

Has many in built functions

Easy manipulation

Flexibility

is a high programming language

it is an object oriented programming language

It supports network and web applications

it is a cross platform programming language

its functions and controls are designed to easily facilitate programming

It supports multi-programming

CHAPTER FIVE
5.0 SUMMARY, RECOMMENDATION AND CONCLUSION
5.1 SUMMARY
Developing a system requires the system developer to meet the user requirements
of the proposed system and as a result of this, the developer must fully understand
what the problems are, understand the people for whom he/she is designing the
system for in order for the system to communicate effectively.
5.2 RECOMMENDATION

25

Considering the rate of technological development in our society today, any


organization that want to remain in (he forefront of todays competitive market is
left with no choice than to automated the manual system that are operational in
their organization. Other recommendations include:

Putting in place computers and other peripherals that would allow the usage
of the system.

A good training background for the users of the system in order to


familiarize with the software.

A recovery/back tip must be in place.

Lastly, adequate environmental security must be provided for the


confidentiality of information.

5.3 CONCLUSION
The development of this application software is to help solve problems associated
with the existing system and this has been achievable to an extent. The merits of
the new system outweigh the advantages (if any) of the existing system. It does not
only provide automation, it has also replaced the traditional cabinet file storage
method that deals with a lot of paper work thereby, allowing case in the storing,
handling and retrieval of data in a dynamic way.
In concluding this project. I would like to highlight areas for future development
and these include:

Reviewing of this project work to see what has been done and then look out
for what the project should have accomplished that has not been implemented
in it for those who desire to continue on this project.
26

Furthermore, certain features must be included in the system in order to


justify improvements on the current version and this include putting in place a
multi-user system that allows for use in a network environment so that
information can he made available in all other Organizations as well other
parts of the organization under study.

REFERENCE
David H. Weaver, Edward B. Bruner, James. M. Smiley and Virginia A. Rose
(2011). Accounting Systems and Procedures. United States of America.
McGraw-Hill. Fifth Edition. pp 443-449.
Gregory E. Anders. Emmajo Spiegel berg and Sally Nelson (2012).
Microcomputer Accounting- Tutorial and Applications. United States of
America, Glencoe/McGraw-Hill, pp 196-197.
27

Jeffrey L. Whitten. Lonnie D. Bentley and Kevin D. Dittman (2008). System


Analysis and Design Methods. New York. Irwin/McGraw-Hill, Fifth
Edition, pp13. 479.
J.L. Bookholdt (2011) Accounting Information System- Transaction Processing
and Controls. United States of America. Irwin/McGraw -Hill, pp 673-674.
Mark Priestley (2012) Practical Object-Oriented Design With, UML. New York.
McGraw-Hill. Second Edition, pp 330-333.
Myrvin F. Chester, Avtar. K. Athwall (2011). Introduction to Basic Information
Systems Analysis and Design .New York. McGraw-Hill. pp 212.
Payroll, Wikipedia the free encyclopedia.htm. 2006. www.alltheweb.com.
Simon Bennet, Steve McRobb and Ray Farmer (2012). Object Oriented Systems
Analysis and Design Using UML. Maiden: McGraw-Hill, Second Edition,
pp301. 321.
Appendix i
//**********************************************************
//
PROJECT PAYROLL
//**********************************************************
//**********************************************************
//
INCLUDED HEADER FILES
//**********************************************************
#include <iostream.h>
#include <fstream.h>
#include <process.h>
#include <string.h>
#include <stdlib.h>
28

#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <dos.h>
//**********************************************************
// THIS CLASS CONTAINS ALL THE DRAWING FUNCTIONS
//**********************************************************
class LINES
{
public :
void LINE_HOR(int, int, int, char) ;
void LINE_VER(int, int, int, char) ;
void BOX(int,int,int,int,char) ;
void CLEARUP(void) ;
void CLEARDOWN(void) ;
};
//**********************************************************
// THIS CLASS CONTROL ALL THE FUNCTIONS IN THE MENU
//**********************************************************
class MENU
{
public :
void MAIN_MENU(void) ;
private :
void EDIT_MENU(void) ;
void INTRODUCTION(void) ; } ;
//**********************************************************
// THIS CLASS CONTROL ALL THE FUNCTIONS RELATED TO EMPLOYEE
//**********************************************************
class EMPLOYEE
{
public :
void NEW_EMPLOYEE(void) ;
void MODIFICATION(void) ;
void DELETION(void) ;
void DISPLAY(void) ;
void LIST(void) ;
void SALARY_SLIP(void) ;
private :
29

void ADD_RECORD(int, char[], char[], char[], int, int, int, char[], char, char, char, float, float)
;
void MODIFY_RECORD(int, char [], char [], char [], char [], char, char, char, float, float) ;
void DELETE_RECORD(int) ;
int LASTCODE(void) ;
int CODEFOUND(int) ;
int RECORDNO(int) ;
int FOUND_CODE(int) ;
void DISPLAY_RECORD(int) ;
int VALID_DATE(int, int, int) ;
int code, dd, mm, yy ;
char name[26], address[31], phone[10], desig[16] ;
char grade, house, convense ;
float loan, basic ;
};
//**********************************************************
// THIS FUNCTION CONTROL ALL THE FUNCTIONS IN THE MAIN MENU
//**********************************************************
void MENU :: MAIN_MENU(void)
{
char ch ;
LINES L ;
L.CLEARUP() ;
while (1)
{
clrscr() ;
gotoxy(14,3);
cout<<" C++ Project for Payroll Management System";
L.BOX(25,7,57,9,218) ;
L.BOX(10,5,71,21,218) ;
L.BOX(11,6,70,20,219) ;
gotoxy(29,8) ;
cout <<"PAYROLL MANAGEMENT SYSTEM" ;
gotoxy(30,11) ;
cout <<"1: NEW EMPLOYEE" ;
gotoxy(30,12) ;
cout <<"2: DISPLAY EMPLOYEE" ;
gotoxy(30,13) ;
cout <<"3: LIST OF EMPLOYEES" ;
gotoxy(30,14) ;
cout <<"4: SALARY SLIP" ;
gotoxy(30,15) ;
cout <<"5: EDIT" ;
gotoxy(30,16) ;
30

cout <<"0: QUIT" ;


gotoxy(30,18) ;
cout <<"ENTER YOUR CHOICE :" ;
gotoxy(5,23);
cout<<"http://codewithc.com, Email : prameshpudasaini13@yahoo.com";
ch = getch() ;
if (ch == 27 || ch == '0')
break ;
else if (ch == '1')
{
EMPLOYEE E ;
E.NEW_EMPLOYEE() ;
}
else if (ch == '2')
{
EMPLOYEE E ;
E.DISPLAY() ;
}
else if (ch == '3')
{
EMPLOYEE E ;
E.LIST() ;
}
else if (ch == '4')
{
EMPLOYEE E ;
E.SALARY_SLIP() ;
}
else if (ch == '5')
EDIT_MENU() ;
}
L.CLEARUP() ;
}
//**********************************************************
// THIS FUNCTION CONTROL ALL THE FUNCTIONS IN THE EDIT MENU
//**********************************************************
void MENU :: EDIT_MENU(void)
{
char ch ;
LINES L ;
L.CLEARDOWN() ;
while (1)
{
31

clrscr() ;
L.BOX(28,8,49,10,218) ;
L.BOX(10,5,71,21,218) ;
L.BOX(11,6,70,20,219) ;
gotoxy(31,9) ;
cout <<"E D I T M E N U" ;
gotoxy(30,13) ;
cout <<"1: DELETE RECORD" ;
gotoxy(30,14) ;
cout <<"2: MODIFY RECORD" ;
gotoxy(30,15) ;
cout <<"0: EXIT" ;
gotoxy(30,17) ;
cout <<"ENTER YOUR CHOICE :" ;
ch = getch() ;
if (ch == 27 || ch == '0')
break ;
else if (ch == '1')
{
EMPLOYEE E ;
E.DELETION() ;
}
else if (ch == '2')
{
EMPLOYEE E ;
E.MODIFICATION() ;
}
}
L.CLEARDOWN() ;
}
//**********************************************************
// THIS FUNCTION DRAWS THE HORRIZONTAL LINE
//**********************************************************
void LINES :: LINE_HOR(int column1, int column2, int row, char c)
{
for ( column1; column1<=column2; column1++ )
{
gotoxy(column1,row) ;
cout <<c ;
}
}
//**********************************************************
// THIS FUNCTION DRAWS THE VERTICAL LINE
32

//**********************************************************
void LINES :: LINE_VER(int row1, int row2, int column, char c)
{
for ( row1; row1<=row2; row1++ )
{
gotoxy(column,row1) ;
cout <<c ;
}
}
//**********************************************************
// THIS FUNCTION DRAWS THE BOX
//**********************************************************
void LINES :: BOX(int column1, int row1, int column2, int row2, char c)
{
char ch=218 ;
char c1, c2, c3, c4 ;
char l1=196, l2=179 ;
if (c == ch)
{
c1=218 ;
c2=191 ;
c3=192 ;
c4=217 ;
l1 = 196 ;
l2 = 179 ;
}
else
{
c1=c ;
c2=c ;
c3=c ;
c4=c ;
l1 = c ;
l2 = c ;
}
gotoxy(column1,row1) ;
cout <<c1 ;
gotoxy(column2,row1) ;
cout <<c2 ;
gotoxy(column1,row2) ;
cout <<c3 ;
gotoxy(column2,row2) ;
cout <<c4 ;
column1++ ;
33

column2-- ;
LINE_HOR(column1,column2,row1,l1) ;
LINE_HOR(column1,column2,row2,l1) ;
column1-- ;
column2++ ;
row1++ ;
row2-- ;
LINE_VER(row1,row2,column1,l2) ;
LINE_VER(row1,row2,column2,l2) ;
}
//**********************************************************
// THIS FUNCTION CLEAR THE SCREEN LINE BY LINE UPWARD
//**********************************************************
void LINES :: CLEARUP(void)
{
for (int i=25; i>=1; i--)
{
delay(20) ;
gotoxy(1,i) ;
clreol() ;
}
}
//**********************************************************
// THIS FUNCTION CLEAR THE SCREEN LINE BY LINE DOWNWORD
//**********************************************************
void LINES :: CLEARDOWN(void)
{
for (int i=1; i<=25; i++)
{
delay(20) ;
gotoxy(1,i) ;
clreol() ;
}
}
//**********************************************************
// THIS FUNCTION ADDS THE GIVEN DATA IN THE EMPLOYEE'S FILE
//**********************************************************

34

void EMPLOYEE :: ADD_RECORD(int ecode, char ename[26], char eaddress[31], char


ephone[10], int d, int m, int y, char edesig[16], char egrade, char ehouse, char econv, float eloan,
float ebasic)
{
fstream file ;
file.open("EMPLOYEE.DAT", ios::app) ;
code = ecode ;
strcpy(name,ename) ;
strcpy(address,eaddress) ;
strcpy(phone,ephone) ;
dd = d ;
mm = m ;
yy = y ;
strcpy(desig,edesig) ;
grade = egrade ;
house = ehouse ;
convense = econv ;
loan = eloan ;
basic = ebasic ;
file.write((char *) this, sizeof(EMPLOYEE)) ;
file.close() ;
}
//**********************************************************
// THIS FUNCTION MODIFY THE GIVEN DATA IN THE
// EMPLOYEE'S FILE
//**********************************************************
void EMPLOYEE :: MODIFY_RECORD(int ecode, char ename[26], char eaddress[31], char
ephone[10], char edesig[16], char egrade, char ehouse, char econv, float eloan, float ebasic)
{
int recno ;
recno = RECORDNO(ecode) ;
fstream file ;
file.open("EMPLOYEE.DAT", ios::out | ios::ate) ;
strcpy(name,ename) ;
strcpy(address,eaddress) ;
strcpy(phone,ephone) ;
strcpy(desig,edesig) ;
grade = egrade ;
house = ehouse ;
convense = econv ;
loan = eloan ;
basic = ebasic ;
int location ;
location = (recno-1) * sizeof(EMPLOYEE) ;
file.seekp(location) ;
35

file.write((char *) this, sizeof(EMPLOYEE)) ;


file.close() ;
}
//**********************************************************
// THIS FUNCTION DELETE THE RECORD IN THE EMPLOYEE FILE
// FOR THE GIVEN EMPLOYEE CODE
//**********************************************************
void EMPLOYEE :: DELETE_RECORD(int ecode)
{
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
file.seekg(0,ios::beg) ;
while (!file.eof())
{
file.read((char *) this, sizeof(EMPLOYEE)) ;
if (file.eof())
break ;
if (code != ecode)
temp.write((char *) this, sizeof(EMPLOYEE)) ;
}
file.close() ;
temp.close() ;
file.open("EMPLOYEE.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while (!temp.eof())
{
temp.read((char *) this, sizeof(EMPLOYEE)) ;
if ( temp.eof() )
break ;
file.write((char *) this, sizeof(EMPLOYEE)) ;
}
file.close() ;
`
temp.close() ;
}
//**********************************************************
// THIS FUNCTION RETURNS THE LAST EMPLOYEE'S CODE
//**********************************************************
int EMPLOYEE :: LASTCODE(void)
36

{
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int count=0 ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
count = code ;
file.close() ;
return count ;
}
//**********************************************************
// THIS FUNCTION RETURNS 0 IF THE GIVEN CODE NOT FOUND
//**********************************************************
int EMPLOYEE :: FOUND_CODE(int ecode)
{
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int found=0 ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
if (code == ecode)
{
found = 1 ;
break ;
}
}
file.close() ;
return found ;
}
//**********************************************************
// THIS FUNCTION RETURNS RECORD NO. OF THE GIVEN CODE
//**********************************************************
int EMPLOYEE :: RECORDNO(int ecode)
{
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int recno=0 ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
recno++ ;
37

if (code == ecode)
break ;
}
file.close() ;
return recno ;
}
//**********************************************************
// THIS FUNCTION DISPLAYS THE LIST OF THE EMPLOYEES
//**********************************************************
void EMPLOYEE :: LIST(void)
{
clrscr() ;
int row = 6 , found=0, flag=0 ;
char ch ;
gotoxy(31,2) ;
cout <<"LIST OF EMPLOYEES" ;
gotoxy(30,3) ;
cout <<"~~~~~~~~~~~~~~~~~~~" ;
gotoxy(1,4) ;
cout <<"CODE NAME
PHONE DOJ
DESIGNATION GRADE
SALARY" ;
gotoxy(1,5) ;
cout
<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~" ;
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
flag = 0 ;
delay(20) ;
found = 1 ;
gotoxy(2,row) ;
cout <<code ;
gotoxy(6,row) ;
cout <<name ;
gotoxy(31,row) ;
cout <<phone ;
gotoxy(40,row) ;
cout <<dd <<"/" <<mm <<"/" <<yy ;
gotoxy(52,row) ;
cout <<desig ;
gotoxy(69,row) ;
cout <<grade ;
38

if (grade != 'E')
{
gotoxy(74,row) ;
cout <<basic ;
}
else
{
gotoxy(76,row) ;
cout <<"-" ;
}
if ( row == 23 )
{
flag = 1 ;
row = 6 ;
gotoxy(1,25) ;
cout <<"Press any key to continue or Press <ESC> to exit" ;
ch = getch() ;
if (ch == 27)
break ;
clrscr() ;
gotoxy(31,2) ;
cout <<"LIST OF EMPLOYEES" ;
gotoxy(30,3) ;
cout <<"~~~~~~~~~~~~~~~~~~~" ;
gotoxy(1,4) ;
cout <<"CODE NAME
PHONE DOJ
DESIGNATION GRADE
SALARY" ;
gotoxy(1,5) ;
cout
<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~" ;
}
else
row++ ;
}
if (!found)
{
gotoxy(5,10) ;
cout <<"\7Records not found" ;
}
if (!flag)
{
gotoxy(1,25) ;
cout <<"Press any key to continue..." ;
getche() ;
}
file.close () ;
}
39

//**********************************************************
// THIS FUNCTION DISPLAYS THE RECORD OF THE EMPLOYEES
//**********************************************************
void EMPLOYEE :: DISPLAY_RECORD(int ecode)
{
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
if (code == ecode)
{
gotoxy(5,5) ;
cout <<"Employee Code # " <<code ;
gotoxy(5,6) ;
cout <<"~~~~~~~~~~~~~" ;
gotoxy(5,7) ;
cout <<"Name
: " <<name ;
gotoxy(5,8) ;
cout <<"Address
: " <<address ;
gotoxy(5,9) ;
cout <<"Phone no. : " <<phone ;
gotoxy(5,11) ;
cout <<"JOINING DATE" ;
gotoxy(5,12) ;
cout <<"~~~~~~~~~~~~" ;
gotoxy(5,13) ;
cout <<"Day : " <<dd ;
gotoxy(5,14) ;
cout <<"Month : " <<mm ;
gotoxy(5,15) ;
cout <<"Year : " <<yy ;
gotoxy(5,17) ;
cout <<"Designation : " <<desig ;
gotoxy(5,18) ;
cout <<"Grade
: " <<grade ;
if (grade != 'E')
{
gotoxy(5,19) ;
cout <<"House (y/n) : " <<house ;
gotoxy(5,20) ;
cout <<"Convense (y/n) : " <<convense ;
gotoxy(5,22) ;
cout <<"Basic Salary : " <<basic ;
}
40

gotoxy(5,21) ;
cout <<"Loan

: " <<loan ;

}
}
file.close() ;
}
//**********************************************************
// THIS FUNCTION GIVE DATA TO ADD IN THE FILE
//**********************************************************
void EMPLOYEE :: NEW_EMPLOYEE(void)
{
clrscr() ;
char ch, egrade, ehouse='N', econv='N' ;
char ename[26], eaddress[31], ephone[10], edesig[16], t1[10] ;
float t2=0.0, eloan=0.0, ebasic=0.0 ;
int d, m, y, ecode, valid ;
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(28,3) ;
cout <<"ADDITION OF NEW EMPLOYEE" ;
gotoxy(5,5) ;
cout <<"Employee Code # " ;
gotoxy(5,6) ;
cout <<"~~~~~~~~~~~~~" ;
gotoxy(5,7) ;
cout <<"Name
:";
gotoxy(5,8) ;
cout <<"Address
:";
gotoxy(5,9) ;
cout <<"Phone no. : " ;
gotoxy(5,11) ;
cout <<"JOINING DATE" ;
gotoxy(5,12) ;
cout <<"~~~~~~~~~~~~" ;
gotoxy(5,13) ;
cout <<"Day : " ;
gotoxy(5,14) ;
cout <<"Month : " ;
gotoxy(5,15) ;
cout <<"Year : " ;
gotoxy(5,17) ;
cout <<"Designation : " ;
gotoxy(5,18) ;
cout <<"Grade
:";
gotoxy(5,21) ;
41

cout <<"Loan

:";

ecode = LASTCODE() + 1 ;
if (ecode == 1)
{
ADD_RECORD(ecode, "null", "null", "null", 0, 0, 0, "null", 'n', 'n', 'n', 0.0, 0.0) ;
DELETE_RECORD(ecode) ;
}
gotoxy(21,5) ;
cout <<ecode ;
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter the name of the Employee" ;
gotoxy(20,7) ;
clreol() ;
gets(ename) ;
strupr(ename) ;
if (ename[0] == '0')
return ;
if (strlen(ename) < 1 || strlen(ename) > 25)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly (Range: 1..25)" ;
getch() ;
}
}
while (!valid) ;
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Address of the Employee" ;
gotoxy(20,8) ;
clreol() ;
gets(eaddress) ;
strupr(eaddress) ;
if (eaddress[0] == '0')
return ;
if (strlen(eaddress) < 1 || strlen(eaddress) > 30)
{
valid = 0 ;
gotoxy(5,25) ;
42

clreol() ;
cout <<"\7Enter correctly (Range: 1..30)" ;
getch() ;
}
}
while (!valid) ;
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Phone no. of the Employee or Press <ENTER> for none" ;
gotoxy(20,9) ;
clreol() ;
gets(ephone) ;
if (ephone[0] == '0')
return ;
if ((strlen(ephone) < 7 && strlen(ephone) > 0) || (strlen(ephone) > 9))
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly" ;
getch() ;
}
}
while (!valid) ;
if (strlen(ephone) == 0)
strcpy(ephone,"-") ;
char tday[3], tmonth[3], tyear[5] ;
int td ;
do
{
valid = 1 ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER DAY OF JOINING" ;
gotoxy(13,13) ;
clreol() ;
gets(tday) ;
td = atoi(tday) ;
d = td ;
if (tday[0] == '0')
return ;
}
while (d == 0) ;
43

do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER MONTH OF JOINING" ;
gotoxy(13,14) ;
clreol() ;
gets(tmonth) ;
td = atoi(tmonth) ;
m = td ;
if (tmonth[0] == '0')
return ;
}
while (m == 0) ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER YEAR OF JOINING" ;
gotoxy(13,15) ;
clreol() ;
gets(tyear) ;
td = atoi(tyear) ;
y = td ;
if (tyear[0] == '0')
return ;
}
while (y == 0) ;
if (d>31 || d<1)
valid = 0 ;
else if (((y%4)!=0 && m==2 && d>28) || ((y%4)==0 && m==2 && d>29))
valid = 0 ;
else if ((m==4 || m==6 || m==9 || m==11) && d>30)
valid = 0 ;
else if (y<1990 || y>2020)
valid = 0 ;
if (!valid)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly" ;
getch() ;
gotoxy(13,14) ;
clreol() ;
gotoxy(13,15) ;
clreol() ;
}
44

}
while (!valid) ;
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Designation of the Employee" ;
gotoxy(20,17) ;
clreol() ;
gets(edesig) ;
strupr(edesig) ;
if (edesig[0] == '0')
return ;
if (strlen(edesig) < 1 || strlen(edesig) > 15)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly (Range: 1..15)" ;
getch() ;
}
}
while (!valid) ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Grade of the Employee (A,B,C,D,E)" ;
gotoxy(20,18) ;
clreol() ;
egrade = getche() ;
egrade = toupper(egrade) ;
if (egrade == '0')
return ;
}
while (egrade < 'A' || egrade > 'E') ;
if (egrade != 'E')
{
gotoxy(5,19) ;
cout <<"House (y/n) : " ;
gotoxy(5,20) ;
cout <<"Convense (y/n) : " ;
gotoxy(5,22) ;
cout <<"Basic Salary : " ;
do
{
gotoxy(5,25) ;
45

clreol() ;
cout <<"ENTER IF HOUSE ALLOWANCE IS ALLOTED TO EMPLOYEE OR NOT" ;
gotoxy(22,19) ;
clreol() ;
ehouse = getche() ;
ehouse = toupper(ehouse) ;
if (ehouse == '0')
return ;
}
while (ehouse != 'Y' && ehouse != 'N') ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER IF CONVENCE ALLOWANCE IS ALLOTED TO EMPLOYEE OR
NOT" ;
gotoxy(22,20) ;
clreol() ;
econv = getche() ;
econv = toupper(econv) ;
if (econv == '0')
return ;
}
while (econv != 'Y' && econv != 'N') ;
}
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER LOAN AMOUNT IF ISSUED" ;
gotoxy(22,21) ;
clreol() ;
gets(t1) ;
t2 = atof(t1) ;
eloan = t2 ;
if (eloan > 50000)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7SHOULD NOT GREATER THAN 50000" ;
getch() ;
}
}
while (!valid) ;
if (egrade != 'E')
{
46

do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER BASIC SALARY OF THE EMPLOYEE" ;
gotoxy(22,22) ;
clreol() ;
gets(t1) ;
t2 = atof(t1) ;
ebasic = t2 ;
if (t1[0] == '0')
return ;
if (ebasic > 50000)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7SHOULD NOT GREATER THAN 50000" ;
getch() ;
}
}
while (!valid) ;
}
gotoxy(5,25) ;
clreol() ;
do
{
gotoxy(5,24) ;
clreol() ;
cout <<"Do you want to save (y/n) " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
if (ch == 'N')
return ;
ADD_RECORD(ecode, ename, eaddress, ephone, d, m, y, edesig, egrade, ehouse, econv,
eloan, ebasic) ;
}
//**********************************************************
// THIS FUNCTION GIVE CODE FOR THE DISPLAY OF THE RECORD
//**********************************************************
47

void EMPLOYEE :: DISPLAY(void)


{
clrscr() ;
char t1[10] ;
int t2, ecode ;
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(5,5) ;
cout <<"Enter code of the Employee " ;
gets(t1) ;
t2 = atoi(t1) ;
ecode = t2 ;
if (ecode == 0)
return ;
clrscr() ;
if (!FOUND_CODE(ecode))
{
gotoxy(5,5) ;
cout <<"\7Record not found" ;
getch() ;
return ;
}
DISPLAY_RECORD(ecode) ;
gotoxy(5,25) ;
cout <<"Press any key to continue..." ;
getch() ;
}
//**********************************************************
// THIS FUNCTION GIVE DATA FOR THE MODIFICATION OF THE
// EMPLOYEE RECORD
//**********************************************************
void EMPLOYEE :: MODIFICATION(void)
{
clrscr() ;
char ch, egrade, ehouse='N', econv='N' ;
char ename[26], eaddress[31], ephone[10], edesig[16], t1[10] ;
float t2=0.0, eloan=0.0, ebasic=0.0 ;
int ecode, valid ;
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(5,5) ;
cout <<"Enter code of the Employee " ;
gets(t1) ;
t2 = atoi(t1) ;
ecode = t2 ;
48

if (ecode == 0)
return ;
clrscr() ;
if (!FOUND_CODE(ecode))
{
gotoxy(5,5) ;
cout <<"\7Record not found" ;
getch() ;
return ;
}
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(22,3) ;
cout <<"MODIFICATION OF THE EMPLOYEE RECORD" ;
DISPLAY_RECORD(ecode) ;
do
{
gotoxy(5,24) ;
clreol() ;
cout <<"Do you want to modify this record (y/n) " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
if (ch == 'N')
return ;
clrscr() ;
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
if (code == ecode)
break ;
}
file.close() ;
gotoxy(5,5) ;
cout <<"Employee Code # " <<ecode ;
gotoxy(5,6) ;
cout <<"~~~~~~~~~~~~~" ;
gotoxy(40,5) ;
cout <<"JOINING DATE : " ;
gotoxy(40,6) ;
cout <<"~~~~~~~~~~~~~~" ;
gotoxy(55,5) ;
cout <<dd <<"/" <<mm <<"/" <<yy ;
49

gotoxy(5,7) ;
cout <<"Name
:";
gotoxy(5,8) ;
cout <<"Address
:";
gotoxy(5,9) ;
cout <<"Phone no. : " ;
gotoxy(5,10) ;
cout <<"Designation : " ;
gotoxy(5,11) ;
cout <<"Grade
:";
gotoxy(5,14) ;
cout <<"Loan
:";
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter the name of the Employee or <ENTER> FOR NO CHANGE" ;
gotoxy(20,7) ;
clreol() ;
gets(ename) ;
strupr(ename) ;
if (ename[0] == '0')
return ;
if (strlen(ename) > 25)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly (Range: 1..25)" ;
getch() ;
}
}
while (!valid) ;
if (strlen(ename) == 0)
{
strcpy(ename,name) ;
gotoxy(20,7) ;
cout <<ename ;
}
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Address of the Employee or <ENTER> FOR NO CHANGE" ;
gotoxy(20,8) ;
clreol() ;
50

gets(eaddress) ;
strupr(eaddress) ;
if (eaddress[0] == '0')
return ;
if (strlen(eaddress) > 30)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly (Range: 1..30)" ;
getch() ;
}
}
while (!valid) ;
if (strlen(eaddress) == 0)
{
strcpy(eaddress,address) ;
gotoxy(20,8) ;
cout <<eaddress ;
}
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Phone no. of the Employee or or <ENTER> FOR NO CHANGE" ;
gotoxy(20,9) ;
clreol() ;
gets(ephone) ;
if (ephone[0] == '0')
return ;
if ((strlen(ephone) < 7 && strlen(ephone) > 0) || (strlen(ephone) > 9))
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly" ;
getch() ;
}
}
while (!valid) ;
if (strlen(ephone) == 0)
{
strcpy(ephone,phone) ;
gotoxy(20,9) ;
cout <<ephone ;
}
do
51

{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Designation of the Employee or <ENTER> FOR NO CHANGE" ;
gotoxy(20,10) ;
clreol() ;
gets(edesig) ;
strupr(edesig) ;
if (edesig[0] == '0')
return ;
if (strlen(edesig) > 15)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7Enter correctly (Range: 1..15)" ;
getch() ;
}
}
while (!valid) ;
if (strlen(edesig) == 0)
{
strcpy(edesig,desig) ;
gotoxy(20,10) ;
cout <<edesig ;
}
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"Enter Grade of the Employee (A,B,C,D,E) or <ENTER> FOR NO CHANGE" ;
gotoxy(20,11) ;
clreol() ;
egrade = getche() ;
egrade = toupper(egrade) ;
if (egrade == '0')
return ;
if (egrade == 13)
{
egrade = grade ;
gotoxy(20,11) ;
cout <<grade ;
}
}
while (egrade < 'A' || egrade > 'E') ;
if (egrade != 'E')
{
52

gotoxy(5,12) ;
cout <<"House (y/n) : " ;
gotoxy(5,13) ;
cout <<"Convense (y/n) : " ;
gotoxy(5,15) ;
cout <<"Basic Salary : " ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ALLOTED HOUSE ALLOWANCE ? or <ENTER> FOR NO CHANGE" ;
gotoxy(22,12) ;
clreol() ;
ehouse = getche() ;
ehouse = toupper(ehouse) ;
if (ehouse == '0')
return ;
if (ehouse == 13)
{
ehouse = house ;
gotoxy(22,12) ;
cout <<ehouse ;
}
}
while (ehouse != 'Y' && ehouse != 'N') ;
do
{
gotoxy(5,25) ;
clreol() ;
cout <<"ALLOTED CONVENCE ALLOWANCE or <ENTER> FOR NO CHANGE" ;
gotoxy(22,13) ;
clreol() ;
econv = getche() ;
econv = toupper(econv) ;
if (econv == '0')
return ;
if (econv == 13)
{
econv = convense ;
gotoxy(22,13) ;
cout <<econv ;
}
}
while (econv != 'Y' && econv != 'N') ;
}
do
{
valid = 1 ;
53

gotoxy(5,25) ;
clreol() ;
cout <<"ENTER LOAN AMOUNT or <ENTER> FOR NO CHANGE" ;
gotoxy(22,14) ;
clreol() ;
gets(t1) ;
t2 = atof(t1) ;
eloan = t2 ;
if (eloan > 50000)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7SHOULD NOT GREATER THAN 50000" ;
getch() ;
}
}
while (!valid) ;
if (strlen(t1) == 0)
{
eloan = loan ;
gotoxy(22,14) ;
cout <<eloan ;
}
if (egrade != 'E')
{
do
{
valid = 1 ;
gotoxy(5,25) ;
clreol() ;
cout <<"ENTER BASIC SALARY or <ENTER> FOR NO CHANGE" ;
gotoxy(22,15) ;
clreol() ;
gets(t1) ;
t2 = atof(t1) ;
ebasic = t2 ;
if (t1[0] == '0')
return ;
if (ebasic > 50000)
{
valid = 0 ;
gotoxy(5,25) ;
clreol() ;
cout <<"\7SHOULD NOT GREATER THAN 50000" ;
getch() ;
}
}
54

while (!valid) ;
if (strlen(t1) == 0)
{
ebasic = basic ;
gotoxy(22,15) ;
cout <<ebasic ;
}
}
gotoxy(5,25) ;
clreol() ;
do
{
gotoxy(5,18) ;
clreol() ;
cout <<"Do you want to save (y/n) " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
if (ch == 'N')
return ;
MODIFY_RECORD(ecode,ename,eaddress,ephone,edesig,egrade,ehouse,econv,eloan,ebasic) ;
gotoxy(5,23) ;
cout <<"\7Record Modified" ;
gotoxy(5,25) ;
cout <<"Press any key to continue..." ;
getch() ;
}
//**********************************************************
// THIS FUNCTION GIVE CODE NO. FOR THE DELETION OF THE
// EMPLOYEE RECORD
//**********************************************************
void EMPLOYEE :: DELETION(void)
{
clrscr() ;
char t1[10], ch ;
int t2, ecode ;
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(5,5) ;
cout <<"Enter code of the Employee " ;
gets(t1) ;
55

t2 = atoi(t1) ;
ecode = t2 ;
if (ecode == 0)
return ;
clrscr() ;
if (!FOUND_CODE(ecode))
{
gotoxy(5,5) ;
cout <<"\7Record not found" ;
getch() ;
return ;
}
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(24,3) ;
cout <<"DELETION OF THE EMPLOYEE RECORD" ;
DISPLAY_RECORD(ecode) ;
do
{
gotoxy(5,24) ;
clreol() ;
cout <<"Do you want to delete this record (y/n) " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
if (ch == 'N')
return ;
DELETE_RECORD(ecode) ;
LINES L ;
L.CLEARDOWN() ;
gotoxy(5,23) ;
cout <<"\7Record Deleted" ;
gotoxy(5,25) ;
cout <<"Press any key to continue..." ;
getch() ;
}
//**********************************************************
// THIS FUNCTION RETURN 0 IF THE GIVEN DATE IS INVALID
//**********************************************************
int EMPLOYEE :: VALID_DATE(int d1, int m1, int y1)
{
int valid=1 ;
56

if (d1>31 || d1<1)
valid = 0 ;
else if (((y1%4)!=0 && m1==2 && d1>28) || ((y1%4)==0 && m1==2 && d1>29))
valid = 0 ;
else if ((m1==4 || m1==6 || m1==9 || m1==11) && d1>30)
valid = 0 ;
return valid ;
}
//**********************************************************
// THIS FUNCTION PRINTS THE SALARY SLIP FOR THE EMPLOYEE
//**********************************************************
void EMPLOYEE :: SALARY_SLIP(void)
{
clrscr() ;
char t1[10] ;
int t2, ecode, valid ;
gotoxy(72,2) ;
cout <<"<0>=EXIT" ;
gotoxy(5,5) ;
cout <<"Enter code of the Employee " ;
gets(t1) ;
t2 = atoi(t1) ;
ecode = t2 ;
if (ecode == 0)
return ;
clrscr() ;
if (!FOUND_CODE(ecode))
{
gotoxy(5,5) ;
cout <<"\7Record not found" ;
getch() ;
return ;
}
fstream file ;
file.open("EMPLOYEE.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(EMPLOYEE)))
{
if (code == ecode)
break ;
}
file.close() ;
int d1, m1, y1 ;
struct date d;
getdate(&d);
57

d1 = d.da_day ;
m1 = d.da_mon ;
y1 = d.da_year ;
char *mon[12]=
{"January","February","March","April","May","June","July","August","September","November
","December"} ;
LINES L ;
L.BOX(2,1,79,25,219) ;
gotoxy(31,2) ;
cout <<"NADEEM AKHTAR, PGDBA - 200754667" ;
L.LINE_HOR(3,78,3,196) ;
gotoxy(34,4) ;
cout <<"SALARY SLIP" ;
gotoxy(60,4) ;
cout <<"Date: " <<d1 <<"/" <<m1 <<"/" <<y1 ;
gotoxy(34,5) ;
cout <<mon[m1-1] <<", " <<y1 ;
L.LINE_HOR(3,78,6,196) ;
gotoxy(6,7) ;
cout <<"Employee Name : " <<name ;
gotoxy(6,8) ;
cout <<"Designation : " <<desig ;
gotoxy(67,8) ;
cout <<"Grade : " <<grade ;
L.BOX(6,9,75,22,218) ;
L.LINE_HOR(10,71,20,196) ;
int days, hours ;
if (grade == 'E')
{
do
{
valid = 1 ;
gotoxy(10,21) ;
cout <<"ENTER NO. OF DAYS WORKED IN THE MONTH " ;
gotoxy(10,11) ;
cout <<"No. of Days : " ;
gets(t1) ;
t2 = atof(t1) ;
days = t2 ;
if (!VALID_DATE(days,m1,y1))
{
valid = 0 ;
gotoxy(10,21) ;
cout <<"\7ENTER CORRECTLY
";
getch() ;
gotoxy(10,11) ;
cout <<"
";
}
58

}
while (!valid) ;
do
{
valid = 1 ;
gotoxy(10,21) ;
cout <<"ENTER NO. OF HOURS WORKED OVER TIME " ;
gotoxy(10,13) ;
cout <<"No. of hours : " ;
gets(t1) ;
t2 = atof(t1) ;
hours = t2 ;
if (hours > 8 || hours < 0)
{
valid = 0 ;
gotoxy(10,21) ;
cout <<"\7ENTER CORRECTLY
";
getch() ;
gotoxy(10,13) ;
cout <<"
";
}
}
while (!valid) ;
gotoxy(10,21) ;
cout <<"
";
gotoxy(10,11) ;
cout <<"
";
gotoxy(10,13) ;
cout <<"
";
}
gotoxy(10,10) ;
cout <<"Basic Salary
: Rs." ;
gotoxy(10,12) ;
cout <<"ALLOWANCE" ;
if (grade != 'E')
{
gotoxy(12,13) ;
cout <<"HRA : Rs." ;
gotoxy(12,14) ;
cout <<"CA : Rs." ;
gotoxy(12,15) ;
cout <<"DA : Rs." ;
}
else
{
gotoxy(12,13) ;
cout <<"OT : Rs." ;
}
59

gotoxy(10,17) ;
cout <<"DEDUCTIONS" ;
gotoxy(12,18) ;
cout <<"LD : Rs." ;
if (grade != 'E')
{
gotoxy(12,19) ;
cout <<"PF : Rs." ;
}
gotoxy(10,21) ;
cout <<"NET SALARY
: Rs." ;
gotoxy(6,24) ;
cout <<"CASHIER" ;
gotoxy(68,24) ;
cout <<"EMPLOYEE" ;
float HRA=0.0, CA=0.0, DA=0.0, PF=0.0, LD=0.0, OT=0.0, allowance, deduction, netsalary ;
if (grade != 'E')
{
if (house == 'Y')
HRA = (5*basic)/100 ;
if (convense == 'Y')
CA = (2*basic)/100 ;
DA = (5*basic)/100 ;
PF = (2*basic)/100 ;
LD = (15*loan)/100 ;
allowance = HRA+CA+DA ;
deduction = PF+LD ;
}
else
{
basic = days * 30 ;
LD = (15*loan)/100 ;
OT = hours * 10 ;
allowance = OT ;
deduction = LD ;
}
netsalary = (basic+allowance)-deduction ;
gotoxy(36,10) ;
cout <<basic ;
if (grade != 'E')
{
gotoxy(22,13) ;
cout <<HRA ;
gotoxy(22,14) ;
cout <<CA ;
gotoxy(22,15) ;
cout <<DA ;
gotoxy(22,19) ;
60

cout <<PF ;
}
else
{
gotoxy(22,13) ;
cout <<OT ;
}
gotoxy(22,18) ;
cout <<LD ;
gotoxy(33,15) ;
cout <<"Rs." <<allowance ;
gotoxy(33,19) ;
cout <<"Rs." <<deduction ;
gotoxy(36,21) ;
cout <<netsalary ;
gotoxy(2,1) ;
getch() ;
}
//**********************************************************
// MAIN FUNCTION CALLING MAIN MENU
//**********************************************************
void main(void)
{
MENU menu ;
menu.MAIN_MENU() ;
}

61

Appendix ii

62

63

64