Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

10.12: Payroll Modification Modify the payroll system of Figs 10.4 10.9 to include private instance variable birthdate in class Employee. Use class Date of Fig

10.12: Payroll Modification Modify the payroll system of Figs 10.4 10.9 to include private instance variable birthdate in class Employee. Use class Date of Fig 8.7 to represent an employees birthday. Add get methods to class Date. Assume that payroll is processed once per month. Create an array of Employee variables to store references to the various employee objects. In a loop, calculate the payroll for each Employee (polymorphic ally), and add a $100.00 bonus to the persons payroll amount if the current month is the one in which the Employees birthdate occurs. use this book to answer this question "Java How To Program late objects" Edition: 10 Author: Paul Deitel, Harvey Deitel

Here is the sample output that I need to get:

-----------------------------------------------------------------

Date object constructor for date 6/15/1944

Date object constructor for date 12/29/1960

Date object constructor for date 9/8/1954

Date object constructor for date 3/2/1965

Employees processed individually:

salaried employee: John Smith

social security number: 111-11-1111

birth date: 6/15/1944

weekly salary: $800.00

earned: $800.00

hourly employee: Karen Price

social security number: 222-22-2222

birth date: 12/29/1960

hourly wage: $16.75; hours worked: 40.00

earned: $670.00

commission employee: Sue Jones

social security number: 333-33-3333

birth date: 9/8/1954

gross sales: $10,000.00; commission rate: 0.06

earned: $600.00

base-salaried commission employee: Bob Lewis

social security number: 444-44-4444

birth date: 3/2/1965

gross sales: $5,000.00; commission rate: 0.04; base salary: $300.00

earned: $500.00

Enter the current month (1 - 12): 6

Employees processed polymorphically:

salaried employee: John Smith

social security number: 111-11-1111

birth date: 6/15/1944

weekly salary: $800.00

earned $800.00 plus $100.00 birthday bonus

hourly employee: Karen Price

social security number: 222-22-2222

birth date: 12/29/1960

hourly wage: $16.75; hours worked: 40.00

earned $670.00

commission employee: Sue Jones

social security number: 333-33-3333

birth date: 9/8/1954

gross sales: $10,000.00; commission rate: 0.06

earned $600.00

base-salaried commission employee: Bob Lewis

social security number: 444-44-4444

birth date: 3/2/1965

gross sales: $5,000.00; commission rate: 0.04; base salary: $300.00

new base salary with 10% increase is: $330.00

earned $530.00

Employee 0 is a SalariedEmployee

Employee 1 is a HourlyEmployee

Employee 2 is a CommissionEmployee

Employee 3 is a BasePlusCommissionEmployee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Implementation

Authors: Edward Sciore

2nd Edition

3030338355, 978-3030338350

More Books

Students also viewed these Databases questions