CSE 101 term paper

13
A TERM PAPER of CSE101 (Foundation of Computing) On Topic: “Pay Calculation of Employee” (Simple Salary Statement) Under the Guidance of: Ms. Manmeet Kaur Faculty of LICA (CSE) Lovely Professional University Submitted by: Sanjeev Kumar Reg. No. 11012052. Section: RK4001-B72.

Transcript of CSE 101 term paper

Page 1: CSE 101 term paper

A

TERM PAPER of CSE101

(Foundation of Computing)

On

Topic: “Pay Calculation of Employee”

(Simple Salary Statement)

Under the Guidance of:

Ms. Manmeet Kaur

Faculty of LICA (CSE)

Lovely Professional University

Submitted by:

Sanjeev Kumar

Reg. No. 11012052.

Section: RK4001-B72.

Page 2: CSE 101 term paper

Acknowledgement

With regards I would like to thanks my Lect. M/s. Manmeet Kaur who helped me in completing my Term Paper on the topic “Pay Calculation of an Employee”. She inspired me greatly to work in this project. Her willingness to motivate us contributed tremendously to my project. I also would like to thank her for showing me some example that related to the topic of our project.

Besides, we would like to thank the authority of Lovely Professional University (LPU) for providing us with a good environment and facilities to complete this project. It gave me an opportunity to participate and learn about the calculation of a employees, I would also like to thank my senior friends who provide me valuable information as the guidance of my project.

Sanjeev Kumar

Page 3: CSE 101 term paper

INTRODUCTION

In the existing system, most of the records are maintained on paper. It becomes very inconvenient to modify the data. In the existing system, here is a possibility that the same data in different registers may have different calculation of employee which means the entries of the same calculation do not match. This inconsistent state does not supply the concrete information which poses a problem in the case information related to particular pay record.

A worker is entitled to holiday from their first day of employment. The minimum statutory entitlement is 5.6 weeks annually.

This tool enables you to calculate a worker's current and future holiday entitlement based on the set number of days or hours they work per week.

An employee's total weekly pay equals the hourly wage multiplied by the total number or regular hours plus any overtime pay. Overtime pay equals the total overtime hours multiplied by 1.5 times the hourly wane. Write a program that prompts the user for the regular and overtime hours of each 5 working days and the hourly wage, and displays the employee’s total weekly pay.

What is Salary?

The term “Salary” includes remuneration in any form for person service, under an expressed or implied contract of employment or service. Salary is used for payroll employee and wages is used for contractual. Salary or wages can be calculated on the number of days in the month.

Page 4: CSE 101 term paper

How many types of salary?

Different-different companies has a different-different types of salary but normally few types of salary would be used-

Basic Salary Encashment of leave salary Advance of salary Arrear of salary Other allowance

About Programming

How to calculate the pay calculation of employee?

The employee classes I could now imagine representing the company as a composite made up of nodes: manager and employees. It would be possible to use a single class to represent all employees, but since each level may have different properties, it might be more useful to define at least two classes- Employees and Bosses. Employees are leaf nodes and can’t have employees under them. Bosses are nodes that may have employee nodes under them.

I will start with the abstract employee class and derive out concrete employee classes from it. In “C” programming I have built in enumeration interface. So I can create an abstract Employee interface that returns an Enumerator. Our concrete employee class will store name and salary of each employee and allow us to fetch them as needed. The employee class must have concrete implementations of the add, remove, get Child, and subordinates is a leaf, all of these will return some short of error indication. The subordinate’s method could return a null but

Page 5: CSE 101 term paper

programming will be more consistent if subordinates return an empty enumeration.

I will use some important function as like that return(), array(), string(), getch(). Starts with the salary of the current employee and then calls the get salary() method on each subordinate. This is , of cause ,recursive and any employees who have subordinates will be include.

Overtime Pay Program:

This is my program so far really basic(have not done the calculation part for the overtime) 

#include <iostream>#include "employee.cpp"using namespace std;

int main(int argc, char* argv){

cEmployee newEmployee;

cout << "OverTime Pay Program" << endl;cout << "Enter amount of Employees: ";

bool cont = false;do {

string stemp;int itemp;string c;cout << endl << "Enter Employees Name:" << endl;cin >> stemp;newEmployee.setName(stemp);cout << endl << "Enter Employee's Salary " << endl;cin >> itemp;newEmployee.setSalary(itemp);cout << endl << "Enter Empmloyee's Hours " << endl;cin >> itemp;newEmployee.setHours(itemp);cout << "Enter Y to enter more employee's or N to quit: ";cin >> c;

Page 6: CSE 101 term paper

if (c == "y"){cont = false;

}else if(c == "n"){cont = true;

}}while (cont = false);

string stemp;stemp = newEmployee.getName();cout << endl << stemp;

cin.ignore();cin.get();return 0;}

employee.cpp:

#include<iostream>#include<string>using namespace std;

class cEmployee {

string sname;double dsalary;int ihours;int iOvertime;double dOvertime_pay;double dTotal_pay;

public:void setName(string name){

sname = name;}void setSalary(double salary){

dsalary = salary;}

void setHours(int hours){

ihours = hours;}

Page 7: CSE 101 term paper

string getName(){

return sname;}

double getSalary(){

return dsalary;}

int getHours(){

return ihours;}

};

Employee   class:

Object-oriented languages typically provide a natural way to treat data and functionality as a single entity. In C++, we do so by creating a class.

Here is a class definition for a generic Employee:

class Employee {public: Employee(string theName, float thePayRate);

string getName() const; float getPayRate() const;

float pay(float hoursWorked) const;

protected: string name; float payRate;};

Represent the calculation of Employee:

Page 8: CSE 101 term paper

We will represent different types of employees:

a generic employee a manager a supervisor

For these employees, we'll store data, like their:

name pay rate

And we'll require some functionality, like being able to:

initialize the employee get the employee's fields (e.g., name) calculate the employee's pay

Source Code:

#include<stdio.h>

#include<conio.h>

void main()

{

char name[50];

float basic_pay,da,ta,hra,lic,income_tax,pf,net_sal,gross_pay;

clrscr();

printf(“enter name”);

Scanf(“%s”,&name);

printf(“enter basic pay”);

Scanf(“%f”,&basic_pay);

printf(“enter da”);

Scanf(“%f”,&da);

printf(“enter ta”);

Scanf(“%f”,&ta);

printf(“enter hra”);

Page 9: CSE 101 term paper

Scanf(“%f”,&hra);

printf(“enter lic”);

Scanf(“%f”,&lic);

printf(“enter income tax”);

Scanf(“%f”,&income_tax);

printf(“enter pf”);

Scanf(“%f”,&pf);

printf(“net sal”);

Scanf(“%f”,&net_sal);

printf(“gross_pay);

Scanf(“%f”,&gross_pay);

printf(“employee_name=%s”,name);

printf(“\nbasic_pay=%f”,basic_pay);

printf(“\nda=%f”,da);

printf(“\nta=%f”,ta);

printf(“\nhra=%f”,hra);

printf(“\nlic=%f”,lic);

printf(“\nincome_tax=%f”,income_tax);

printf(“\npf=%f”,pf);

printf(“\nnet_sal=%f”,net_sal);

printf(“\ngross_pay=%f”,gross_pay);

gross_pay=basic_pay+da+ta+hra+lic+income_tax+pf+net_sal+gross_pay;

printf(“\ngross_pay=%f”,gross_pay);

net_sal=gross_pay-pf-lic;

printf(“\nnet_pay=%f”,net_sal);

Getch();

}

Conclusion:

Page 10: CSE 101 term paper

Compensation is usually provided as base pay and/or variable pay. Base pay is based on the role in the organization and the market for the expertise required conducting that role. Variable pay is based on the performance of the person in that role, for example, for how well that person achieved his or her goals for the year. Incentive plans, for example, bonus plans, are a form of variable pay. (Some people might consider bonuses as a benefit, rather than a form of compensation.) Some programs include a base pay and a variable pay.

References:

http://managementhelp.org http:// www.wikipedia.org http://www.citehr.com http://www.sourcecodeonline.com http://www.2dix.com