-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPracticeShippingProject.py
71 lines (60 loc) · 2.32 KB
/
PracticeShippingProject.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
59
60
61
62
63
64
65
66
67
68
69
70
71
#Guided(ish) Python Shipping Project, 10/7/2022
#Beginner
#Ground Shipping
def GroundShipping(weight):
if weight <= 2:
price_per_pound = 1.50
flat_rate = 20.00
premium_rate = 125.00
cost = (price_per_pound * weight) + flat_rate
premium_cost = cost + premium_rate
print("Ground Shipping Total Cost: " + "{:.2f}".format(cost))
print("Ground Shipping Premium Cost: " + "{:.2f}".format(premium_cost))
elif weight > 2 and weight <= 6:
price_per_pound = 3.00
flat_rate = 20.00
premium_rate = 125.00
cost = (price_per_pound * weight) + flat_rate
premium_cost = cost + premium_rate
print("Ground Shipping Total Cost: " + "{:.2f}".format(cost))
print("Ground Shipping Premium Cost: " + "{:.2f}".format(premium_cost))
elif weight > 6 and weight <= 10:
price_per_pound = 4.00
flat_rate = 20.00
premium_rate = 125.00
cost = (price_per_pound * weight) + flat_rate
premium_cost = cost + premium_rate
print("Ground Shipping Total Cost: " + "{:.2f}".format(cost))
print("Ground Shipping Premium Cost: " + "{:.2f}".format(premium_cost))
elif weight > 10:
price_per_pound = 4.75
flat_rate = 20.00
premium_rate = 125.00
cost = (price_per_pound * weight) + flat_rate
premium_cost = cost + premium_rate
print("Ground Shipping Total Cost: " + "{:.2f}".format(cost))
print("Ground Shipping Premium Cost: " + "{:.2f}".format(premium_cost))
#Drone Shipping
def DroneShipping(weight):
if weight <= 2:
price_per_pound = 4.50
flat_rate = 0.00
cost = (weight * price_per_pound) + flat_rate
print("Drone Shipping Total Cost: " + "{:.2f}".format(cost))
elif weight > 2 and weight <= 6:
price_per_pound = 9.00
flat_rate = 0.00
cost = (weight * price_per_pound) + flat_rate
print("Drone Shipping Total Cost: " + "{:.2f}".format(cost))
elif weight > 6 and weight <= 10:
price_per_pound = 12.00
falt_rate = 0.00
cost = (weight * price_per_pound) + flat_rate
print("Drone Shipping Total Cost: " + "{:.2f}".format(cost))
elif weight > 10:
price_per_pound = 14.25
flat_rate = 0.00
cost = (weight * price_per_pound) + flat_rate
print("Drone Shipping Total Cost: " + "{:.2f}".format(cost))
GroundShipping(41.5)
DroneShipping(41.5)