-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPythonRateCalculator.py
58 lines (32 loc) · 1.43 KB
/
PythonRateCalculator.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Do our import
import subprocess, sys
# This is a script that is going to work out the hourly rate of pay for an employee
# Introduce the script
print("Welcome to the Hourly Rate Calculator for Example Company")
# Collect Employee information - also declares some of our variables
EmployeeNumber = input("What is your employee number?")
EmployeeNumber = int(EmployeeNumber)
# Sanity check on the employee number - is it 7 charachters long? Is it purely numbers?
if len(str(EmployeeNumber)) == 4:
# Now we work out the rate of pay - do this using an IF on the employee number. The higher the
# number the more the rate
# 3200 - 3300 = £16.66 per hour
# 3301 - 3400 = £17.66 per hour
# 3401 - 3500 = £18.66 per hour
# 3501 - 3600 = £19.66 per hour
# 3601 - 3610 = £20 per hour
# Now we do the calculation on that - or import from another script
if EmployeeNumber > 3200 < 3300:
PayRate = 16.66
if EmployeeNumber > 3301 < 3400:
PayRate = 17.66
if EmployeeNumber > 3401 < 3500:
PayRate = 18.66
if EmployeeNumber > 3501 < 3600:
PayRate = 19.66
if EmployeeNumber > 3601 < 3610:
PayRate = 20
print("Your rate of pay is £",PayRate,"." "Is that correct?")
RateCorrect = input("Please enter Yes or No")
if RateCorrect == "Yes":
print ("Thanks. Now we will move on to calculating your total hourly pay")