Question: I need to edit the following program to include a try and except block to calculate the amount of overtime hours. def computepay ( hours

I need to edit the following program to include a try and except block to calculate the amount of overtime hours.
def computepay(hours, rate) :
# print("In computepay", hours, rate)
if hours >40:
reg = rate * hours
otp =(hours -40.0)*(rate *0.5)
pay = reg + otp
else:
pay = hours * rate
# print("Returning",pay)
return pay
name = input("Enter your name: ")
ID = input("Enter your employ ID number: ")
h = input("Enter Hours: ")
r = input("Enter Rate: ")
fh = float(h)
fr = float(r)
xp = computepay(fh,fr)
print("Gross Pay:",xp)

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 Programming Questions!