question archive Create an employee class hierarchy (inheritance) in order to solve the following problem: Assume, a company pays its employees in every weekly

Create an employee class hierarchy (inheritance) in order to solve the following problem: Assume, a company pays its employees in every weekly

Subject:Computer SciencePrice: Bought3

Create an employee class hierarchy (inheritance) in order to solve the following problem: Assume, a company pays its employees in every weekly. There are four different groups of employees. 

 

(1) SalariedEmployee: Receives fixed weekly payments regardless of the number of hours they work at the workplace.

(2) HourlyEmployee: Employees are paid by the amount of hours they work. They also receive overtime pay for working over 40 hours. i.e. if an hourly employee works 50 hours in a week, the first 40 hours would be paid by regular payment, remaining (50-40) 10 hours will be overtime payment that is 1.5 times of the regular payment rate.

(3) CommissionEmployee: Commission employees are paid by a percentage of their total sales.

(4) BasePlusCommissionEmployee: This group receives a base salary, additionally they also receives a percentage of their total sales.

 

Input/Output of the Program

 

 

If Executed Correctly, Your ptogram will show the following output:

Employees processed individually:

Salaried employee: Mahbub Murshed
Social security number: 111-22-3333
Weekly salary $800.00
Earned $800.00

Hourly employee: Michael Jackson
Social security number: 111-22-4444
Hourly wage $16.75; Hours worked 45
Earned $795.63

Commission employee: Susan Harper
Social security number: 444-44-4444
Gross sales $10000.00; Commission rate $0.06
Earned $600.00

Base-salaried-commission employee: Manpreet Kaur
Social security number: 777-77-7777
Gross sales $5000.00; Commission rate $0.04; Base salary $300.00
Earned $500.00

Utilise polymorphism to iterate across different employees:

Salaried employee: Mahbub Murshed
Social security number: 111-22-3333
Weekly salary $800.00
Earned $800.00

Hourly employee: Michael Jackson
Social security number: 111-22-4444
Hourly wage $16.75; Hours worked 45
Earned $795.63

Commission employee: Susan Harper
Social security number: 444-44-4444
Gross sales $10000.00; Commission rate $0.06
Earned $600.00

New base-salary with 30% increase is: $390
Base-salaried-commission employee: Manpreet Kaur
Social security number: 777-77-7777
Gross sales $5000.00; Commission rate $0.04; Base salary $390.00
Earned $590.00

Employee 1 is SalariedEmployee
Employee 2 is HourlyEmployee
Employee 3 is CommissionEmployee
Employee 4 is BasePlusCommissionEmployee

pur-new-sol

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions