Question: PLEASE PROVIDE ACODE IN JAVA Design a HourlyWorker class. The class should store the payrate passed to it in its constructor. If the payrate is

PLEASE PROVIDE ACODE IN JAVA

Design a HourlyWorker class. The class should store the payrate passed to it in its constructor. If the payrate is less than 0, throw an exception, InvalidPayRate. The error message should say The pay rate cannot be negative. and should include the payrate in the message.

The test class should prompt the user to enter the pay rate.

Submit three java files, HourlyWorkder, InvalidPayRate, and test classes.

Other Requirements:

Add Comments in your program.

The program should have proper formatting.

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!