The file must be called <Payroll.java> (driver program) Employee.java Hourly.jav
ID: 3542404 • Letter: T
Question
The file must be called <Payroll.java> (driver program)
Employee.java
Hourly.java (which extends employee)
Salaried.java (which extends employee)
SalariedPlusCommission.java (which extends Salaried)
Ensure you include ALL files required to make your program compile and run.
I would like to see your .java files only.
Proper coding conventions required the first letter of the class start with a capital
letter and the first letter of each additional word start with a capital letter.
Overall Requirements
Write an employee payroll program that uses polymorphism to calculate and print the
weekly payroll for your company. There are three types of employees ? hourly,
salaried, and salaried plus commission. Each type of employee gets paid using a
different formula. But for all employee types, if the calculated paycheck exceeds
$1000, the actual paycheck must be decreased to $1000.
Use this class hierarchy:
Use the public access modifier for the toString method in the Employee class and
the load method in the Employee, Hourly, Salaried, and SalariedPlusCommission
Employee.java class 20%Instance variables:
name
social security number
birthday month
birthday week
load method :
Prompts the user for instance-variable values and loads the entries.
toString method:
Returns a string that shows the employee
Explanation / Answer
Sample Output
Press 1 to add employee
Press 2 to print PAYCHECK REPORT
Press 3 to exit
1
type Hourly(1), Salaried (2), Salaried plus Commission (3)
Enter 1, 2, or 3 ==>1
Name ==>James Smith
Social security number ==>123-45-6789
Birthday month (1-12)2
Birthday bonus week (1-4)3
Hourly pay ==>20
Hours worked this past week ==>30
Press 1 to add employee
Press 2 to print PAYCHECK REPORT
Press 3 to exit
1
type Hourly(1), Salaried (2), Salaried plus Commission (3)
Enter 1, 2, or 3 ==>2
Name ==>Rick Dees
Social security number ==>888-88-8888
Birthday month (1-12)9
Birthday bonus week (1-4)3
Salary ==>700
Press 1 to add employee
Press 2 to print PAYCHECK REPORT
Press 3 to exit
1
type Hourly(1), Salaried (2), Salaried plus Commission (3)
Enter 1, 2, or 3 ==>3
Name ==>Sara Heart
Social security number ==>999-99-9999
Birthday month (1-12)7
Birthday bonus week (1-4)3
Salary ==>400
Sales for this past week ==>2000
Sales commission rate (fraction paid to employee) ==>0.25
Press 1 to add employee
Press 2 to print PAYCHECK REPORT
Press 3 to exit
2
employee: James Smith
social security number: 123-45-6789
paycheck: 600.0
employee: Rick Dees
social security number: 888-88-8888
paycheck: 800.0
employee: Sara Heart
social security number: 999-99-9999
paycheck: 900.0
Press 1 to add employee
Press 2 to print PAYCHECK REPORT
Press 3 to exit
3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.