System Analysis Design and Its
Applications
Fall 2006
Case 1: Create an Employee class for a basic payroll program to compute the net pay salary of hourly based employees. To define the class, include the appropriate data members, member functions, and access modifiers. For simplicity, use a constant tax rate of 30% to compute the tax amount. Employees that work over 40 hours will receive overtime pay of one and a half of their hourly rate for overtime hours worked. The output should display the name of each employee, hours worked, hourly rate, overtime pay, regular (gross) pay, tax amount, and net pay.
Case 2: Expand the Employee Payroll program to include hourly based and salary based employees. This phase uses an array of employee objects, inheritance for different classes of employees, and polymorphism for salary computation. The 52 week yearly salary as well as number of overtime hours worked by a salary based employee is given). For salary based employees, to find the regular (gross) pay for a week, divide the salary by 52. To compute the overtime pay for a salary based employee, first find the hourly rate by dividing the gross pay by 40, and then compute overtime pay. For every employee, overtime pay, tax amount, and net pay must also be computed. In addition, the program should find the minimum and maximum net pay of all employees as well as sort the employees based on their net pay (ascending order).
![]()
![]()
![]()


![]()
![]()
![]()


![]()
| Employee |
|
Declaration name, hourly worked, hourly rate, overtime hours
|
|
Virtual Functions
|
|
Regular Pay
Using Hours Worked, Hourly Rate
|
|
Hourly Rate Gross pay /40
|
|
Net Pay gpay( ) - tamt( )
|
|
Over Time Pay
Using Hours Worked, Hourly Rate
|
|
Over Time Pay
Using Hours Worked, Hourly Rate
|
|
Input Employee
name, hours worked, hourly rate, etc
|
|
Input Employee
name, hours worked, Salary
|


|
Gross Pay
Regular Pay + Overtime Pay
|
|
Gross Pay
Salary/52
|
|
Display
name, hours worked, hourly rate, gross pay, Overtime pay, net Pay, tax amount
|
|
Main Function
Selecting hourly or salaried employee using switch function. Sorting employee in ascending order of net pay using bubble sort
|
|
Display
name, hours worked, hourly rate, gross pay, Overtime pay, net Pay, tax amount
|

|
Tax Amount
Gross Pay * Tax Rate
|
|
Tax Amount
Gross Pay * Tax Rate
|
![]()
![]()