Last active
May 30, 2020 23:48
-
-
Save jmangrad/2b5e8760fd0c034e9dc175ca15b46869 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write a program to prompt the user for hours and rate per | |
hour to compute gross pay. give the employee 1.5 | |
times the hourly rate for hours worked above 40 hours. | |
Enter Hours: 45 | |
Enter Rate: 10 | |
Pay: 475.0 | |
hours = int(input("Enter hours worked: ")) # asks user for hours worked for the week | |
rate = float(input("Enter how much you earn per hour: ")) # asks user how much per hour they get paid | |
if hours > 40: | |
pay = (1.5 * rate * (hours -40) + (40 * rate)) | |
print(pay) | |
else: | |
pay = rate * hours | |
print(pay) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment