-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgross-pay-overtime.py
More file actions
45 lines (41 loc) · 1.01 KB
/
gross-pay-overtime.py
File metadata and controls
45 lines (41 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#CALCULATE GROSS PAY WITH OVERTIME:
hrs = input('How many hours did you work?')
rte = input('What is your hourly rate?')
try:
hours = float(hrs)
rate = float(rte)
ot = (hours-40)*(rate*0.5)
reg = hours*rate
if hours <= 40:
print(reg)
else :
print(ot+reg)
except:
print('Cannot compute non-numeric characters. Starting over.')
#okay, let's try that again!
hrs = input('How many hours did you work?')
rte = input('What is your hourly rate?')
try:
hours = float(hrs)
rate = float(rte)
ot = (hours-40)*(rate*0.5)
reg = hours*rate
if hours <= 40:
print(reg)
else :
print(ot+reg)
except:
print('Error: Pay attention idiot. Integers only. One more try.')
hrs = input('How many hours did you work?')
rte = input('What is your hourly rate?')
try:
hours = float(hrs)
rate = float(rte)
ot = (hours-40)*(rate*0.5)
reg = hours*rate
if hours <= 40:
print(reg)
else :
print(ot+reg)
except:
print('Error: Numeric input only. Too late dumbass, you had your chance! Goodbye.')