Question: For this lab you will modify your Lab 7 to make several improvements to the getter / setter methods. Instead of having them return True
For this lab you will modify your Lab to make several improvements to the gettersetter
methods. Instead of having them return TrueFalse modify each one to throw an exception if
invalid data is passed.
Modify these methods in the following way:
addhoursx
o If the number of hours being added is less than throw an exception. Do not
change how the hours are distributed if the number of hours added is greater
than
setemployeenumberx
o The employee number must be an integer. If the given input is not an integer,
throw an exception
setofficenumberx
o If the office number given is less than or greater than throw an
exception.
setnamex
o If the given name is empty, throw an exception
o Any of the following characters should be removed from the name:
Underscore period, and dash
setbirthdatem d y
o If the given value for the month is less than or greater than throw an
exception
o If the given value for the day is less than or greater than throw a different
exception
You do not need to round or truncate your output. Name your class Worker
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
