Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the Employee and Production Worker classes so they throw exceptions when the following errors occur: The Employee class should throw an exception named Invalid

Modify the Employee and Production Worker classes so they throw exceptions when the following errors occur:
The Employee class should throw an exception named Invalid Employee Number when it receives an invalid employee number
The Production Worker class should throw an exception named Invalid Shift when it receives an invalid Shift
The Production Worker class should throw an exception named invalid Pay Rate 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 production Worker classes from HW #2 _______ Employee and Production Worer Classes Design a class named Employee. The class should keep the following information in fields:
Employee name
Employee number
Hire date
Write one or more constructors and the appropriate accessor and mutator methods for the class. Next, write a class named Production Worker that extends the Employee class.
The Production Worker class should have fields to hold the following formation:
Shift (an integer)
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Students also viewed these Programming questions

Question

Provide a brief description of the seven basic steps to use JDBC.

Answered: 1 week ago

Question

Identify the relative strengths and weaknesses of the measures

Answered: 1 week ago

Question

How many categories (K) are we working with?

Answered: 1 week ago