Question: Use java Program: Your Employee class will have the employees name and hourly rate. There will be a method in the class called getPay that

Use java Program: Your Employee class will have the employees name and hourly rate. There will be a method in the class called getPay that will receive the hours worked and return the pay. The name and hourly rate will be private. You will use get and set methods to assign values to the name and hourly rate. You will also have a displayEmployee method that prints out the employee name and hourly rate. The rate should show 2 decimal places: Example: Robin Banks earns $9.50 Calculate Pay method: If an employee works 40 hours or less the pay is simple the rate times the hours worked. If the employee works more than 40 hours he gets paid at the regular rate for the first 40 hours, and is paid at one and a half for each overtime hour. The main program should declare 3 different employees. One should work 30 hours, one 40, and one 42. Display the employee information and the weeks pay. A class should not interact with the user. If an invalid value is received it simple does not accept it. It does not display a message, it does not exit. It is up to the calling program to check if the value was accepted and display an appropriate message.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!