Payroll JAVA

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 2 methods:
1. getGrossPay() that returns the employee’s gross pay, which is calculated as the number of hours worked multiplied by the hourly pay rate.
2. getEstimatedTax() that returns the employee’s estimated tax, which is 30% 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: 1000
Enter the first employee’s hourly pay rate: 100
Enter the number of hours worked by the first employee: 160
Enter the second employee’s name: Name Two
Enter the second employee’s ID number: 2000
Enter the second employee’s hourly pay rate: 50
Enter the number of hours worked by the second employee: 160
Employee Payroll Data
Name: Name One
ID Number: 1000
Hourly pay rate: 100.0
Hours worked: 160.0
Gross pay: $16000.0
Est. Tax: $4800.0
Name: Name Two
ID Number: 2000
Hourly pay rate: 50.0
Hours worked: 160.0
Gross pay: $8000.0
Est. Tax: $2400.0

×
New Download