Question: Write a function called calcGrossPay that has two parameters: one for hours (int) and one for pay rate (double). If hours is less than 0

Write a function called calcGrossPay that has two parameters: one for hours (int) and one for pay rate (double). If hours is less than 0 or greater than 60, throw an exception with a message stating that the hours are not within an acceptable range. If the pay rate is less than 7.25 throw an exception with a message stating that minimum wage is 7.25. Create a main function that includes a try/catch block and write how the catch block will handle the exception. Create a final catch block to handle any other exception that is not the expressed exceptions that you (the programmer) were responsible for throwing.

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!