Question: PLEASE USE BEGGINNERS JAVA CODE. NO ADVANCE CODE. Design a Payroll class that has fields for an employee's name, ID number, hourly pay rate, and
PLEASE USE "BEGGINNERS" JAVA CODE. NO ADVANCE CODE.
Design a Payroll class that has fields for an employee's name, ID number, hourly pay rate, and number of hours worked. Write the appropriate accessor methods and a
constructor that accepts the employee's name, ID number, hourly pay rate, and number of hours worked as arguments.
The class should also have methods:
getGrossPay that returns the employee's gross pay, which is calculated as the number of hours worked multiplied by the hourly pay rate.
getEstimatedTax that returns the employee's estimated tax, which is of the gross pay.
Write a program that demonstrates the class by creating two Payroll objects, then asking the user to enter the data for two employees. The program should display
employee's name, ID number, the amount of gross pay earned and the amount of estimated tax. Here is an example of the program's output:
Enter the first employee's name: Name One
Enter the first employee's ID number:
Enter the first employee's hourly pay rate:
Enter the number of hours worked by the first employee:
Enter the second employee's name: Name Two
Enter the second employee's ID number:
Enter the second employee's hourly pay rate:
Enter the number of hours worked by the second employee:
Employee Payroll Data
Name: Name One
ID Number:
Hourly pay rate:
Hours worked:
Gross pay: $
Est. Tax: $
Name: Name Two
ID Number:
Hourly pay rate:
Hours worked:
Gross pay: $
Est. Tax: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
