Created
October 24, 2014 15:46
-
-
Save pbhj/426b66119595e1ea3883 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
# python program to calculate pay | |
# pr4e exercise 3.1; pbhj | |
# assign variables to user values entered | |
# no checking yet | |
hrs = raw_input("Enter Hours: ") | |
h = float(hrs) | |
rate = raw_input("Enter Rate: ") | |
r = float(rate) | |
if h >= 40: | |
# pay is normal rate to 40 hours + | |
# 1.5 times rate for additional hours | |
pay = (40 * r) + ((h - 40) * (1.5 * r)) | |
print pay | |
if h < 40: | |
pay = h * r | |
print pay | |
#end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment