1. Update the payroll program, so that if user enters more than 60 hours a week, it should display double time for hours more than 60, one-half time more than 40 and less than or equal to 60. On the end program should display the gross pay for that employee or user. Save the program in payroll.py.

Respuesta :

Answer:

The initial program was not provided.

I'll answer the question base on the following assumptions.

1. I'll declare a rate of payment for hours more than 60 and a different rate of payment for hours between 40 and 60.

2. Gross payment is calculated by rates of payment * hours worked.

# Program starts here

# Comments are used for explanatory purpose

def main():

#accept input for hours

x= input ("Enter Hours Worked per week")

#convert to integer

hours = int(x)

#accept input for rate of payment

y= input ("Enter Rate of payment per week")

#convert to integer

Rate = int(y)

#test the range of values of hours

if(hours>60):

st= "double time for hours more than 60"

elif(hours>=40 && hours<=60):

st= "one-half time more than 40 and less than or equal to 60"

print(st)

Gross = Rate * hours

print(Gross)