Source Code
price_of_package=int(input("Enter the price of the package you would like to purchase: "))
total_distance=int(input("Enter the total distance of the delivery in kilometers: "))
print("Choose shipping preference:\n1. Air \n2. Freight")
c=int(input())
cost_per_distance = 0
if (c==1):
cost_per_distance = 0.36
elif (c==2):
cost_per_distance = 0.25
print("Choose type of insurance:\n1. Full insurance \n2. limited insurance")
c2=int(input())
insurance_cost = 0
if(c2==1):
insurance_cost = 50
elif(c2==2):
insurance_cost = 25
print("Add gift?:\n1. Yes \n2. No")
c3=int(input())
gift_cost = 0
if(c3==1):
gift_cost = 15
elif(c3==2):
gift_cost = 0
print("Choose type of delivery:\n1. Priority delivery \n2. Standard delivery")
c4=int(input())
type_delivery_cost=0
if(c4==1):
type_delivery_cost = 100
elif(c4==2):
type_delivery_cost = 20
total_cost = price_of_package + total_distance*cost_per_distance + insurance_cost + gift_cost + type_delivery_cost
print("Total Cost: ",total_cost)
Sample Output
Comments
Leave a comment