Write a program, called Paycheck.(CODE MUST BE IN JAVA) A paycheck has the hourly wage and hours worked for a specific employee.
It also has how many hours the employee worked on the weekend. Your program should include the
following:
Multiargument constructor that initializes instance variables appropriately
Appropriate getters and setters
A method, amountEarned, that accepts the salary that calculates and returns the total amount the
employee earned.
o If the employee doesn’t work at least 20 hours they receive a penalty of $10.
o If the employee worked overtime (over 40 hours) they earn time and a half plus their normal
salary for the week*.
o If the employee worked over the weekend, they earn holiday pay plus their normal salary for
the week**.
o Order of Precedence: employees working under 20 hours will always receive a penalty, even if
they worked on the weekend. Working on the weekend trumps overtime. They cannot receive
both!
Write a tester class, PaycheckTester, that reads in the name and salary of an employee from the user. Then
ask how many hours the employee worked in the past week and if they worked over the weekend, how many
hours they worked. Be sure to account for upper and lowercase answers. Print a paycheck for the employee.
Make sure to format nicely, round all numbers to the nearest hundredth, and include comments.
Sample Output:
Enter your first name: Jane
Enter your last name: Doe
Enter your hourly wage: 9.25
How many hours did you work this week? 43
Did you work over the weekend? no
Jane Doe earned $411.63
Enter your first name: John
Enter your last name: Doe
Enter your hourly wage: 12.45
How many hours did you work this week? 51.5
Did you work over the weekend? Yes
How many hours did you work over the weekend? 5
John Doe earned $765.68
*For every hour of overtime, the employee receives 1.5 their usual rate.
** For every hour of holiday pay, the employee receives double their regular rate.