-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program_5-23.py
34 lines (30 loc) · 959 Bytes
/
Program_5-23.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
def main():
sales = get_sales()
advanced_pay = get_advanced_pay()
comm_rate = determine_comm_rate(sales)
pay = sales * comm_rate - advanced_pay
print('The pay is $', format(pay, ',.2f'), sep='')
if pay < 0:
print('The Salesperson must be reimbursed')
print('the company.')
def get_sales():
monthly_sales = float(input('Enter the monthly sales: '))
return monthly_sales
def get_advanced_pay():
print('Enter the amount of advanced pay, or')
print('enter 0 if no advanced pay was given.')
advanced = float(input('advanced pay: '))
return advanced
def determine_comm_rate(sales):
if sales < 10000.00:
rate = 0.10
elif sales >= 10000 and sales <= 14999.99:
rate = 0.12
elif sales >= 15000 and sales <= 17999.99:
rate = 0.14
elif sales >= 18000 and sales <= 21999.99:
rate = 0.16
else:
rate = 0.18
return rate
main()