Archived
1
0
Fork 0
This repository has been archived on 2024-05-10. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
PY4E/Assignment 4.6/main.py
Michael Loveys bb326fbd0a inital commit
2021-09-08 10:33:48 -05:00

25 lines
No EOL
661 B
Python

def computepay (hours, rate):
try:
hours = float(hours)
rate = float(rate)
except:
print("Invalid hours or rate received")
return 0;
totalpay = 0
if hours > 40:
# Standard Pay for first 40 hours
totalpay = (40 * rate)
# Total Pay is added to Overtime Pay for everything over the first 40 at 1.5x the rate
totalpay = totalpay + ((hours - 40) * (rate * 1.50))
else:
totalpay = hours * rate;
return totalpay
workedhours = input("Enter Hours Worked: ")
hourlyrate = input("Enter Hourly Rate: ")
print("Pay", computepay(workedhours,hourlyrate))