Ask Question
17 May, 12:14

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 May, 15:30
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers