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

2010-2011

Project Report on
“PAYROLL
MANAGEMENT
SYSTEM”
For partial fulfillment of Annual
Examination 2011

Guided by: MR.DINESH KUMAR RAM


Submitted by: Name: JACOB JOY

Class: XII A
Roll No: 10
2010-2011

Project
Report on
“PAYROLL
MANAGEMENT
SYSTEM”
For partial fulfillment of Annual
Examination 2011

Guided by: MR.DINESH KUMAR RAM

Submitted by: Name: AROSH E R


Roll No: 04
Class: XII A

TITLE OF THE PROJECT


OBJECTIVE

This project helps various small scale and large scale companies

to generate pay roll slips to the various groups of the employyes.it

also generate various types of allowances &incentive to the

staffs.the system will automtically show correct salary to the staff

depending upon their grade.


ACKNOWLEDGEMENTS

We would like to thank all of our friends who supported us to

complete this project .

We would also like to thank aptech institution for providing many

innovative ideas for the completion of project.this will not be complete

unless we say thanks to our parents as they provided necessary things.


INTRODUCTION
To succeed in a world with greater time demands and learner profit

margns,we must find alternatives to the way we do business,. one

alternative is to simiplify the working environment by out sourcing

on crore functions, such as payroll.payroll management has been

serving these payroll needs for small and midsize companies since

1989.

whether you are one person company or several hundred

person company,timei an issue.payroll management guaranteezs

you will save time by reducing the hour spent producing payroll

information and preparing payroll registers,quaterly,and year to

date payroll reports .we will save your time by promting

preparation of yourw-2’s at year end by eleiminating time spent

balancing and cross checking for errors.

payroll management can help you to avoid penalties due to mis

calculations by doing this work for you.


CONTENTS

SL .NO TOPICS PAGE


NO
1
2
3
4
5
6
7
8
9

ANALYSIS
SYSTEM SPECIFICATIONS
SYSTEM DESIGN-THE KERNEL OF SYSTEM
ENGINEERING
The importance of software design can be stated with a
single word quality.design is the place where quality is
fostered in software development.design provides us
with representations of software that can be accessed
for qualitysystem design serves as the foundation for all
software engineering and maintenance steps that follow.
FUNCTIONAL INFORMATION
MODEL MODEL

DATA DESIGN
BEHAVIOURAL
MODEL

DESIGN

ARCHITECTURAL
OTHER DESIGN
REQUIREMENTS

CODE

PROCEDURAL
DESIGNS PROGRAMME
MODULE

INTEGRATED
TEST
AND
VALIDATED
SOFTWARE

PROCEDURE AND FUNCTION


DESCRIPTION

class payfile - base class


this class defines data related to monthly pay file

PRIVATE:
DATAMEMBERS:-
int emp_num;
char emp_name[25];
char emp_designation[20];
int days_worked,dw;
float basic_pay;
float DA;
float HRA;
float CCA
float con_veyance;
float gross_pay
float PF;
float income_tax
float other_deductions;
float net_pay;

PUBLIC :

CONSTRUCTOR:
payfile() no arguments constructor

DATAMEMBERS:-
days_worked=0;
basic_pay=DA=HRA=CCA=con_veyance=gross_pay=0.0;
PF=income_tax=other_deductions=net_pay=0.0;

MEMBER FUCTIONS:
void get_pay();
This function reads the private members of payfile

void update_pay_file();
This function calls get_pay() and generates
monthly pay file on disk

void reports();
This function reads the monthly pay file
from disk and generates salary statements
when a new employee is registered,this function
writes its record using
payfile()constructor on disk to make a entry in monthl
payfile
void add_pay_object(int code,char name[25],char desig[10],float basic);
when an employee leaves the company,this function deletes
the entry from monthly pay file

void del_pay_object(int code);


this function modifies designation of an
employee in monthly pay file
void modify_pay_object(int code,char desig[20])
void modify_basic(int code,float basic);
This function modifies the basic in pay file

//
class employee: Derived class
this class defines the data and member functions related
to employee file
{
PRIVATE:
DATAMEMBERS:
int employee_num;
char employee_name[25];
char employee_address[3
date_rec date_joining;
date_rec date_birth;
char desig_nation[20];
float basic_salary;

PUBLIC:
MEMBER FUNCTIONS:
int get_rec_no();
This function generates record no.automatically
void get_data();
This function get a record from the operator
void show_data();
This function displays data
void add_object();
This function writes a record on the disk
void show_object();
This function reads a record from the disk and calls
showdata()
void del_object();
This function deletes a record from the
employee file and calls a member function of base
class to update entries in monthly pay file
void modify_object();
This function changes information on disk
void search_object();
This function searches information on the basis of
a given field
int employee::get_rec_no()
This function generates record no. automatically

emp - Object of the class employee


SINGLE INHERITANCE:

BASE CLASS

PAY FILE
INHERITS
PROPRTIES
FROM BASE
CLASS

DERIVED CLASS :

EMPLOYEE
Payroll is advised to be viewed in respect of an employer and NOT

individual employee. It is the disbursement of Company funds to it's

employees and the management, withholding taxes, PF, retirement

plans...In other words, it is total earnings earned in a year by all

workers employed by an employer engaged in an industry.

Managing a firm's payroll can become quite complicated due to the

diverse types of employees a company may employ; full-time, part-time,


salaried exempt, salaried non-exempt, contractor, etc and due to global

locations.

Payroll Management

Payroll Management is the linchpin to most of the information an

organisation has regarding its employees. While many organisations

espouse to using Human Resource Information Systems (HRIS), the

reality is somewhat different. Current technology and software

packages allow employers to store a vast array of inter-related

information about employees. However, much of this information is not

viewed as critical, and therefore often overlooked. Basic employee

information must however be kept for payroll purposes. This will also

form the basis for any other HR related information.

Information recorded will include:

Name,

Address,

Date of birth,

Grade of pay,

Salary level,

Taxation status

Positions held,
Much of this is gathered when an employee is first registered on the

payroll, but why is this important? Human resources can utilise this

information to produce workforce profiles such as age, salary

distribution, geographic location, and service length. All of these allow

for greater HR planning. It is therefore imperative that payroll and HR

have a clear line of communication.

This however is just the tip of the iceberg. Other reasons for ensuring

clear

communication between HR and payroll are:

• HR relies on payroll for historic information for reporting purposes,

annual reports etc.

• Any plans to change award or enterprise agreement conditions must

include input from the payroll area.


Distinctive functions:

• Keep detailed individual employment records

• Maintain multiple open payroll transaction registers

• Retain wage encumbrances and records of running balances


• Print individual checks or submit electronic deposits

• Create and generate W-2's, worksheets, check and payroll registers

• Quarterly tax information reporting

• On screen inquiries, lookups

• Interface capability to time recording devices

The Defintion

1. A payroll system is the method used by payroll professionals to pay

employees for their services. Regardless of the type of system used,

there are basic functions that must be performed--calculation of hours

worked, deductions (401k, health, garnishment), and benefits (auto

allowance, vacation, personal time).

Manual

2. A manual payroll system is typically used by small organizations. The

primary benefit is that it's very inexpensive to set up and maintain.

Businesses using this system do not have to invest in a software or

spend money on training classes for the payroll processors. They can

also establish their own payroll system instead of adhering to the rules

of payroll software. They can log and maintain employee hours and

tax records, according to how they see fit.


Computerized

3. A computerized payroll system saves on time and lowers your error

ratio. You can enter payroll payment information quicker than with a

manual system, and run payroll registers to double-check your

information before printing the checks. This allows you to detect

errors and adjust them beforehand. Additionally, computerized

payrolls simplify tax processing (941s and W-2s) by computing the

data for you and allowing you to do bulk print runs.

External

4. Many companies use an external payroll service, such as Paychex and

ADP, to process their payroll for them. This eliminates the stress of

processing it yourself. Outside services also offer direct deposit

services, where employees' paychecks are electronically transported

into their bank accounts. Additionally, companies using them do not

have to invest money in an in-house payroll software. They do not

have to spend the money on in-house processors.

Choice

5. When choosing a payroll system for your company, select the one that

benefits you most. Companies with fewer than 10 employees


(especially if the hours or salaries tends to remain the same each pay

period) generally benefit more from a manual system. For companies

with 10 to 50 employees, purchasing a software package is advisable,

as long the software is relatively simple to use. A large firm with 50

employees or more should go with an external payroll service.

Structure

6. Once you've chosen the payroll system that works best for your

company, you'll want to ensure that your payroll structure is organized

and efficient. For manual payrolls, keep copies of all payroll

information (copies of checks and types of payments made, including

taxes). For computerized and external payroll systems, create various

spreadsheets to document each payroll. Do not depend on the software

only to maintain your payroll records, as they can malfunction,

resulting in the loss of crucial payroll data.


CODE

#include<conio.h>
#include<iomanip.h>
#include<graphics.h>
#include<string.h>
#include<dos.h>
#include<fstream.h>
#include<stdio.h>
struct date_rec
int dd;
int mm;
int yyyy;
}current_date;

class payfile
{
private:
int emp_num;
char emp_name[25];
char emp_designation[20];
int days_worked,dw;
float basic_pay;
float DA;
float HRA;
float CCA;
float con_veyance;
float gross_pay;
float PF;
float income_tax;
float other_deductions;
float net_pay;

public:
payfile()
{
days_worked=0;
basic_pay=DA=HRA=CCA=con_veyance=gross_pay=0.0;
PF=income_tax=other_deductions=net_pay=0.0;
}
void get_pay();
void update_pay_file();
void reports();

void add_pay_object(int code,char name[25],char desig[10],float basic);

void del_pay_object(int code);

void modify_pay_object(int code,char desig[20]);

void modify_basic(int code,float basic);


}pay;

void payfile::modify_basic(int code,float basic)


{
fstream file;
file.open("payfile.dat",ios::in|ios::out);
file.seekg(0,ios::beg);file.read((char*)&pay,sizeof(pay));
int n=file.tellg();
while(!file.eof())
{
if(code==pay.emp_num)
{
pay.basic_pay=basic;
pay.gross_pay=pay.basic_pay+pay.DA+pay.HRA+pay.CCA+pay.con_ve
yance;
pay.net_pay=pay.gross_pay-
(pay.PF+pay.income_tax+pay.other_deductions);
file.seekg(n-sizeof(pay));
file.write((char*)&pay,sizeof(pay));
file.flush();
file.seekg(0,ios::end);
}
file.read((char*)&pay,sizeof(pay));
n=file.tellg();
}
file.close();
}
void payfile::add_pay_object(int code,char name[25],char desig[20],
float basic)
{
fstream outfile;
pay.emp_num=code;
pay.basic_pay=basic;
strcpy(pay.emp_name,name);
strcpy(pay.emp_designation,desig);
outfile.open("payfile.dat",ios::app);
write((char*)&pay,sizeof(pay));
outfile.close();
}
void payfile::del_pay_object(int code)
{
fstream outfile,infile;
outfile.open("tempfile.dat",ios::app);
infile.open("payfile.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&pay,sizeof(pay));
while(!infile.eof())
{
if(pay.emp_num!=code)
outfile.write((char*)&pay,sizeof(pay));
infile.read((char*)&pay,sizeof(pay));
}
infile.close();
outfile.close();
remove("payfile.dat");
rename("tempfile.dat","payfile.dat");
}
void payfile::modify_pay_object(int code,char desig[20])
{
fstream file;
file.open("payfile.dat",ios::in|ios::out);
file.seekg(0,ios::beg);
file.read((char*)&pay,sizeof(pay));
int n=file.tellg();
while(!file.eof())
{
if(code==pay.emp_num)
{
strcpy(pay.emp_designation,desig);
file.seekg(n-sizeof(pay));
file.write((char*)&pay,sizeof(pay));
file.flush();
file.seekg(0,ios::end);
}
file.read((char*)&pay,sizeof(pay));
n=file.tellg();
}
file.close();
}
void payfile::get_pay()
{
char ch,month[9];
int mon;
cout< <"\n ENTER MONTH ( 1 to 12 ) --------->";
cin>>mon;
switch(mon)
{
case 1 : strcpy(month,"JANUARY");
break;
case 2 : strcpy(month,"FEBRUARY");
break;
case 3 : strcpy(month,"MARCH");
break;
case 4 : strcpy(month,"APRIL");
break;
case 5 : strcpy(month,"MAY");
break;
case 6 : strcpy(month,"JUNE");
break;
case 7 : strcpy(month,"JULY");
break;
case 8 : strcpy(month,"AUGUST");
break;
case 9 : strcpy(month,"SEPTEMBER");
break;
case 10 :strcpy(month,"OCTOBER");
break;
case 11 :strcpy(month,"NOVEMBER");
break;
case 12 :strcpy(month,"DECEMBER");
break;
}
int n;
if(mon==1||mon==3||mon==5||mon==7||mon==8||mon==10||mon==12)
{
n=31;
}
else if(mon==2)
{
n=28;
}
else
{
n=30;
}
cout< <"\n ENTER THE NO.OF DAYS WORKED----------->";
cin>>days_worked;
if(days_worked&lt;23)
{
dw=23-days_worked;
days_worked=n-dw;

}
else
{
days_worked=n;
dw=0;
}
cout< <"\n================================";
cout<<"\n In the month of "<<month;
cout<<"\n There are "<<dw<<" day / days with out pay ";
cout<<"\nTHE BASIC PAY FOR THE MONTH IS
"<<(basic_pay/n)*days_worked;
cout<<"\n THE DEARNESS ALLOWENCE IS (35% of basic) --------->";
DA=(0.35*(basic_pay/n))*days_worked;
cout< <setiosflags(ios::fixed)<<setprecision(2)<<DA;
cout<<"\n THE HOUSE RENT ALLOWENCE IS (@ Rs.600/-pm)-------
>";
HRA=600;
cout< <HRA;
cout<<"\n THE CCA IS (2% of basic) ------------------------>";
CCA=(0.02*(basic_pay/n))*days_worked;
cout< <CCA;
cout<<"\n THE CONVEYENCE ALLOWENCE IS (1% of basic)--------
>";
con_veyance=(0.01*(basic_pay/n))*days_worked;
cout< <con_veyance;
gross_pay=((basic_pay/n)*days_worked)+DA+HRA+CCA+con_veyance;
cout<<"\n PF AMOUNT------------------------------>";
PF=gross_pay*0.08;
cout< <PF;
if(gross_pay>8000)
{
cout< <"\n THE INCOME TAX------------------>";
income_tax=(gross_pay-PF)*.1;
cout< <income_tax;
}
else
{
income_tax=0;
cout<<income_tax;
}
cout<<"\n OTHER DEDUCTIONS---------------->";
cin>>other_deductions;
net_pay=gross_pay-(PF+income_tax+other_deductions);
gotoxy(22,24);
cout< <"PRESS ANY KEY TO CONTINUE";
getch();
clrscr();
}
void payfile::update_pay_file()
{
fstream file;
file.open("payfile.dat",ios::in|ios::out);
file.seekg(0,ios::beg);
file.read((char*)&pay,sizeof(pay));
int n=file.tellg();
while(!file.eof())
{
clrscr();
cout<<"\n ENTER DATA FOR EMPLOYEE NO.--------->"<
<pay.emp_num;
pay.get_pay();
file.seekg(n-sizeof(pay));
file.write((char*)&pay,sizeof(pay));
file.flush();
file.seekg(n);
file.read((char*)&pay,sizeof(pay));
n=file.tellg();
}
file.close();
}

class employee:public payfile


{
private:
int employee_num;
char employee_name[25];
char employee_address[35];
date_rec date_joining;
date_rec date_birth;
char desig_nation[20];
float basic_salary;

public:
char ch;
int get_rec_no();
void get_data();
void show_data();
void add_object();
void show_object();

void del_object();
void modify_object();
void search_object();
}emp;

int employee::get_rec_no()
{
int found=0;
int recno,temp_recno;
struct node
{
int rec_no;
node *link;
};
node *start,*ptr,*ptr1,*ptr2;
fstream infile;
infile.open("employee.dat",ios::in);
infile.seekg(0,ios::end);
int n=infile.tellg();
infile.close();
if(n==0)
recno=1;
else
{
infile.open("employee.dat",ios::in);
start=ptr=new node;
infile.seekg(0,ios::beg);
infile.read((char*)&emp,sizeof(emp));
while(!infile.eof())
{
ptr->rec_no=employee_num;
ptr->link=new node;
ptr=ptr->link;
infile.read((char*)&emp,sizeof(emp));
}
ptr->link=NULL;

ptr1=start;
while(ptr1->link!=NULL)
{
ptr2=ptr1->link;
while(ptr2!=NULL)
{
if(ptr2->rec_no<ptr1 ->rec_no)
{
temp_recno=ptr2->rec_no;
ptr2->rec_no=ptr1->rec_no;
ptr1->rec_no=temp_recno;
}
ptr2=ptr2->link;
}
ptr2=ptr1->link;
ptr1=ptr2;
}
ptr1=start;
while(ptr1!=NULL&&found!=1)
{
ptr2=ptr1;
ptr1=ptr1->link;
if((ptr2->rec_no)+1!=ptr1->rec_no)
{
recno=(ptr2->rec_no)+1;
found=1;
}
}
if(found!=1)
recno=(ptr2->rec_no)+1;

ptr=start;
while(start!=NULL)
{
start=start->link;
delete ptr;
}
}
return recno;
}

void employee::get_data()
{
clrscr();
employee_num=get_rec_no();
cout< <"\n ENTER THE NAME------------------------->";
gets(employee_name);
cout< <"\n ENTER THE ADDRESS----------------------->";
gets(employee_address);
cout< <"\n ENTER THE DATE OF JOINING<<dd/mm/yyyy>>------->";
cin>>date_joining.dd>>ch>>date_joining.mm>>ch>>date_joining.yyyy;
cout< <"\n ENTER THE DATE OF BIRTH <<dd/mm/yyyy>>-------->";
cin>>date_birth.dd>>ch>>date_birth.mm>>ch>>date_birth.yyyy;
cout< <"\n ENTER DESIGNATION----------------------->";
gets(desig_nation);
cout< <"\n ENTER THE BASIC SALARY------------------>";
cin>>basic_salary;
}
void employee::show_data()
{
clrscr();
cout< <"\n EMPLOYEE NO.--------------------->"< <employee_num;
cout<<"\n EMPLOYEE's NAME------------------>"< <employee_name;
cout<<"\n DATE OF JOINING------------------>"< <date_joining.dd
<<"-"<<date_joining.mm
<<"-"<<date_joining.yyyy;
cout<<"\n EMPLOYEE's ADDRESS--------------->"< <employee_address;
cout<<"\n DATE OF BIRTH-------------------->"< <date_birth.dd
<<"-"<<date_birth.mm
<<"-"<<date_birth.yyyy;
cout<<"\n DESIGNATION---------------------->"< <desig_nation;
cout<<"\n BASIC SALARY--------------------->RS."< <setw(15)//set width
<<setprecision(2)//set position of decimal point
<<setiosflags(ios::left)//set left justified output
<<setiosflags(ios::showpoint)//always show decimal point
<<setiosflags(ios::fixed)//set fixed notation for display
<<basic_salary;
gotoxy(22,24);
cout<<"PRESS ANY KEY TO CONTINUE";
getch();
}

void employee::add_object()
{
fstream outfile;
char choice='y';

while(choice=='y')
{
clrscr();
char ch;

outfile.open("employee.dat",ios::app);
emp.get_data();
outfile.write((char*)&emp,sizeof(emp));
outfile.flush();
outfile.close();
add_pay_object(emp.employee_num,emp.employee_name,emp.desig_natio
n,
emp.basic_salary);
cout<<"\n ANY MORE EMPLOYEE TO BE ADDED---------------->";
cin>>choice;
}

void employee::show_object()
{
fstream infile;
infile.open("employee.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&emp,sizeof(emp));
while(!infile.eof())
{
emp.show_data();
infile.read((char*)&emp,sizeof(emp));
}
}

void employee::del_object()
{
int code;
fstream infile,outfile;
cout< <"\n ENTER THE MEMBERSHIP NO.TO BE DELETED--------->";
cin>>code;
outfile.open("tempfile.dat",ios::app);
infile.open("employee.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&emp,sizeof(emp));
while(!infile.eof())
{
if(emp.employee_num!=code)

outfile.write((char*)&emp,sizeof(emp));
infile.read((char*)&emp,sizeof(emp));
}
infile.close();
outfile.close();

remove("employee.dat");
rename("tempfile.dat","employee.dat");
}

void employee::modify_object()
{
fstream file;
int mod_choice;
int code;
do
{
clrscr();
cout< <"\n MODIFY MENU ";
cout<<"\n-------------------";
cout<<"\n CHANGED ADDRESS ....1";
cout<<"\n CHANGE DESIGNATION ....2";
cout<<"\n CHANGE BASIC SALARY ....3";
cout<<"\n EXIT MODIFY MENU ....4";
cout<<"\n\n ENTER YOUR CHOICE NO.----------->";
cin>>mod_choice;
if(mod_choice!=4)
{
cout< <"\n ENTER THE EMPLOYEE NUMBER--------->";
cin>>code;
file.open("employee.dat",ios::in|ios::out);
file.seekg(0,ios::beg);
file.read((char*)&emp,sizeof(emp));
int n=file.tellg();
while(!file.eof())
{
if(code==emp.employee_num)
{
switch(mod_choice)
{
case 1 : clrscr();
cout< <"\n ENTER THE NEW ADDRESS-------------->";
gets(emp.employee_address);
file.seekg(n-sizeof(emp));
file.write((char*)&emp,sizeof(emp));
file.flush();
break;

case 2 : clrscr();
cout< <"\n ENTER THE NEW DESIGNATION------------>";
gets(desig_nation);
file.seekg(n-sizeof(emp));

file.write((char*)&emp,sizeof(emp));
file.flush();
modify_pay_object(code,desig_nation);
break;

case 3 : clrscr();

cout< <"\n ENTER NEW BASIC SALARY-------------->";


cin>>basic_salary;
file.seekg(n-sizeof(emp));

file.write((char*)&emp,sizeof(emp));
file.flush();
modify_basic(code,basic_salary);
break;

}
}
file.read((char*)&emp,sizeof(emp));
n=file.tellg();
}
file.close();
}
}
while(mod_choice!=4);
clrscr();
cout< <"\n YOU ENDED THE MODIFY SESSION ";
cout<<"\n THANK YOU!";
delay(700);
}

void employee::search_object()
{
fstream infile;
int search_choice;
int phno;
int code;
char name[25];
do
{
int counter=0;
clrscr();

cout<<"\n SEARCH MENU ";


cout<<"\n----------------------";
cout<<"\n EMPLOYEE CODE ....1";
cout<<"\n EMPLOYEE NAME ....2";
cout<<"\n EXIT ....3";
cout<<"\n\n ENTER YOUR CHOICE NO.---------->";
cin>>search_choice;
switch(search_choice)
{
case 1 : clrscr();
cout< <"\n ENTER THE MEMBER CODE TO BE SEARCHED
----------->";
cin>>code;
infile.open("employee.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&emp,sizeof(emp));
while(!infile.eof())
{
if(emp.employee_num==code)
{
counter ++;
emp.show_data();
}
infile.read((char*)&emp,sizeof(emp));
}
infile.close();
gotoxy(22,20);
cout< <"RECORDS FOUND="<<counter;
getch();
break;

case 2 : clrscr();
cout<<"\n ENTER THE NAME TO BE SEARCHED----------->";
cin>>name;
infile.open("employee.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&emp,sizeof(emp));
while(!infile.eof())
{
if(strcmpi(emp.employee_name,name)==0)
{
counter++;
emp.show_data();
}
infile.read((char*)&emp,sizeof(emp));
}
infile.close();
gotoxy(22,20);
cout< <"RECORDS FOUND="<<counter;
getch();
break;

case 3 : clrscr();
gotoxy(22,15);//set position for display
cout<<"YOU ENDED THE SEARCH SESSION";
gotoxy(27,18);
cout<<"THANK YOU!";
delay(700);
break;

}
}
while(search_choice!=3);
}
void payfile::reports()
{
fstream infile;
int report_choice;
do
{
clrscr();
cout<<"\n REPORT MENU ";
cout<<"\n----------------------------";
cout<<"\n LIST OF ALL EMPLOYEES ....1";
cout<<"\n SALARY STATEMENTS OF ALL EMPLOYEES ....2";
cout<<"\n SALARY SLIP OF ALL EMPLOYEES ....3";
cout<<"\n EXIT REPORTS SESSION ....4";
cout<<"\n\n REPORT ON WHAT ? < ENTER CHOICE NO.>------->";
cin>>report_choice;
switch(report_choice)
{
case 1 : clrscr();
emp.show_object();
break;

case 2 : clrscr();
cout< <"\n-------------------------------------------------";
cout<<"\n RAJ CORPORATION ";
cout<<"\n-------------------------------------------------";
cout<<"\n EMP.NO. EMP.NAME DESIG ";
cout<<"\nBASIC DA HRA CCA CONVEYANCE GROSS
PAY";
cout<<"\n PF ITAX OTHER DED. ******* NET PAY ";
cout<<"\n----------------------------------------------------\n";
infile.open("payfile.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&pay,sizeof(pay));
while(!infile.eof())
{
cout<<" ";
cout<<setiosflags(ios::left)t
<<setw(9)
<<pay.emp_num
<<setw(14)
<<pay.emp_name;
cout<<setiosflags(ios::left)
<<setw(17)
<<pay.emp_designation<<endl;
cout<<"EARNINGS:-";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.basic_pay
<<setw(10)
<<pay.DA
<<setw(10)
<<pay.HRA
<<setw(10)
<<pay.CCA
<<setw(10)
<<pay.con_veyance
<<setw(12)
<<pay.gross_pay
<<endl;
cout<<"DEDUCTIONS :- ";
cout<<setiosflags(ios::fixed)
<<setprecision(2)
<<setiosflags(ios::showpoint)
<<setw(10)
<<pay.PF
<<setw(10)
<<pay.income_tax
<<setw(10)
<<pay.other_deductions
<<setw(15)
<<"************"
<<pay.net_pay
<<endl;
infile.read((char*)&pay,sizeof(pay));
}
infile.close();
gotoxy(22,24);
cout<<"PRESS ANY KEY TO CONTINUE";
getch();
break;

case 3 : clrscr();
char ch,month[9];
cout<<"\n ENTER CURRENT DATE <<dd/mm/yyyy>>--------->";
cin>>current_date.dd>>ch
>>current_date.mm>>ch
>>current_date.yyyy;
switch(current_date.mm)
{
case 1 : strcpy(month,"JANUARY");
break;
case 2 : strcpy(month,"FEBRUARY");
break;
case 3 : strcpy(month,"MARCH");
break;
case 4 : strcpy(month,"APRIL");
break;
case 5 : strcpy(month,"MAY");
break;
case 6 : strcpy(month,"JUNE");
break;
case 7 : strcpy(month,"JULY");
break;
case 8 : strcpy(month,"AUGUST");
break;
case 9 : strcpy(month,"SEPTEMBER");
break;
case 10 :strcpy(month,"OCTOBER");
break;
case 11 :strcpy(month,"NOVEMBER");
break;
case 12 :strcpy(month,"DECEMBER");
break;
}
infile.open("payfile.dat",ios::in);
infile.seekg(0,ios::beg);
infile.read((char*)&pay,sizeof(pay));
while(!infile.eof())
{
clrscr();
cout< <"\n-----------------------------------------------------------";
cout<<"\!!!!!!!!!!!!!!!! HERO HONDA LIMITED!!!! ";
cout<<"\n SALARY SLIP FOR THE MONTH OF
"<<month<<"-"<<current_date.yyyy;
cout<<"\n-----------------------------------------------------------";
cout<<"\n EMPLOYEE NO. :"<<setiosflags(ios::left)
<<setw(10)
<<pay.emp_num;
cout<<" NAME:";
cout<<setiosflags(ios::left)
<<setw(20)
<<pay.emp_name;
cout<<"\n\n EARNINGS DEDUCTIONS ";
cout<<"\n ----------------- ----------------";
cout<<"\n BASIC : RS."<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.basic_pay;
cout<<" PF : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.PF;
cout<<"\n DA : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.DA;
cout<<" ITAX : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.income_tax;
cout<<"\n HRA : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.HRA;
cout<<" OTHER DEDUCTIONS : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.other_deductions;
cout<<"\n CCA : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.CCA;
cout<<"\n CONVEYANCE : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.con_veyance;
cout<<"\n\n GROSS PAY : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.gross_pay;
cout<<" TOTAL DEDUCTIONS : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.gross_pay-pay.net_pay;
cout<<"\n NET PAY : RS.";
cout<<setiosflags(ios::fixed)
<<setiosflags(ios::showpoint)
<<setprecision(2)
<<setw(12)
<<pay.net_pay;
cout<<"\n---------------------------------------------------";
cout<<"\n SIGNATORY AUTHORITY";
cout<<"\n---------------------------------------------------";
cout<<"\n---------------------------------------------------";
gotoxy(22,24);
cout<<"PRESS ANY KEY TO CONTINUE";
getch();
infile.read((char*)&pay,sizeof(pay));
}
infile.close();
break;

case 4 : clrscr();
gotoxy(22,15);
cout<<"YOU ENDED THE REPORT SESSION ";
gotoxy(27,18);
cout<<"THANK YOU!";
delay(700);
break;

}
}
while(report_choice!=4);
void main()
{
int main_choice;
do
{
clrscr();
gotoxy(22,7);
cout<<" MAIN MENU ";
gotoxy(22,8);
cout<<"-----------------------";
gotoxy(22,10);
cout<<"REGISTER A NEW EMPLOYEE ....1";
gotoxy(22,11);
cout<<"REMOVE AN EMPLOYEE ....2";
gotoxy(22,12);
cout<<"MODIFY INFORMATION ABOUT AN EMPLOYEE ....3";
gotoxy(22,13);
cout<<"SEARCH FOR INFORMATION ABOUT AN EMPLOYEE ....4";
gotoxy(22,14);
cout<<"UPDATE MONTHLY PAY FILE ....5";
gotoxy(22,15);
cout<<"REPORTS ....6";
gotoxy(22,16);
cout<<"EXIT ....7";
gotoxy(25,20);
cout<<"ENTER YOUR CHOICE NO.-------------->";
cin>>main_choice;
switch(main_choice)
{
case 1 : emp.add_object();
break;

case 2 : emp.del_object();

break;

case 3 : emp.modify_object();
break;

case 4 : emp.search_object();
break;

case 5 : pay.update_pay_file();

break;

case 6 : pay.reports();
break;

case 7 : clrscr();
gotoxy(25,10);
cout< <"YOU ENDED THE SESSION ";
gotoxy(27,12);
cout<<"THANK YOU!";
delay(1000);
break;

}
}
while(main_choice!=7);
}
OUTPUT
REFERENCE
a) COMPUTER SCIENCE NCERT TEXT BOOK XI.

b) WWW.SOURCECODE.COM

c) OBJECT ORIENTED PROGRAMMING BOOK.

d) WWW.ICBSE.COM
.

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