Ask Question
17 April, 09:05

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.

+3
Answers (1)
  1. 17 April, 11:18
    0
    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)
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “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, ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers