I have to calculate gross pay for an employee and display the results. Your program will accept the employee’s name, hours worked, and the employee’s pay rate. The program will need to calculate overtime as well. Overtime is defined as anything over 40 hours is paid at 1.5 times the regular pay. The program should print the employee’s name, the gross pay amount, and only if there was overtime, print the overtime pay amount as well. Finally, the program should repeat as necessary until the user enters a sentinel value.
print("Payroll Calculator")
EmployeesName = input("Please enter employees Name or 0 to quit:")
WeeklyHours = int(input("Please Enter Hours Worked:"))
PayRate = int(input("Please Enter Pay Rate:"))
print("Normal Pay Rate is:", 40 * PayRate)
if(WeeklyHours > 40):
Overtime = PayRate * 1.5
if(WeeklyHours > 40):
print("Your Overtime Hours are:", WeeklyHours - 40)
print("Your Overtime Rate is:", Overtime * 1.5)
GrossPay = WeeklyHours * Overtime
print("Your Gross Pay is:", WeeklyHours * Overtime)
That is what I have and there is no loop in the program. I can't seem to get this thing figured out and I am going crazy over here. I just want someone to help break it down for me. Thanks!