Question: Modify the Employee and ProductionWorker classes so they throw exceptions when the following errors occur: middot The Employee class should throw an exception named InvalidEmployeeNumber

 Modify the Employee and ProductionWorker classes so they throw exceptions when

Modify the Employee and ProductionWorker classes so they throw exceptions when the following errors occur: middot The Employee class should throw an exception named InvalidEmployeeNumber when it receives an invalid employee number middot The ProductionWorker class should throw an exception named InvalidShift when it receives an invalid Shift middot The ProductionWorker class should throw an exception named invalidePayRate when it receives a negative number for the hourly pay rate. Write a test program that demonstrates how each of these exception conditions works. ________ The Employee and productionWorker classes from HW #2 _______ Employee and ProductionWorkder Classes Design a class named Employee. The class should keep the following information in fields: middot Employee name middot Employee number middot Hire date Write one or more constructors and the appropriate accessor and mutator methods for the class. Next, write a class named ProductionWorker that extends the Employee class. The ProductionWorker class should have fields to hold the following formation: middot Shift (an integer) middot Hourly pay rate (a double) The workday is divided into two shifts: day and night. The shift field will be an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift. Write one or more constructors and the appropriate accessor and mutator methods for the class

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!