using Python Create a program that determines the cost of sending out coffee.
The Konditorei coffee shop sells coffee at $10.50 a pound for their Jonestown Brew, and $16.95 for their Plymouth Jolt. The cost of shipping is $0.93 per pound. In addition, there is a handling cost of $2.50 per order. When the user places an order they will choose one of the two types of coffee, they will enter the number of pounds they are ordering. They will enter in their City and State. They will pick the Delivery method: Overnight, 2-Day or Standard. They will enter in their payment option: PayPal, Credit Card, Check.
You will display the Coffee type and number of pounds they have ordered, the Sub-Total (price * quantity), the Shipping & Handling Costs, Delivery Costs, the City and State it is being shipped to, the Delivery Method, Payment fee, the Payment type, The Tax and the Total. Format in US currency where appropriate (with 2 decimal places, do not use the round function).
The Tax Rate is 9% for Washington, California and Texas, 0% for Oregon or Florida, all other are 7%. The Tax Rate is applied to the Sub-Total. The delivery methods are Overnight ($20.00), 2-Day ($13.00), Standard ($0.00). For Payment options, Paypal has a 3% fee (of the Sub-Total), Credit Cards has a 5% fee (of the Sub-Total), and Checks have a 2% discount (of the Sub-Total),
You are required to use functions. One function to determine the Shipping & Handling costs, another function to determine the Tax and another to determine the Sub-Total.
Use a Try Except block to catch the program from blowing up.
Make the user entry easy by reviewing and using POSSIBLE SOLUTIONS: Disc - Easy User Entry.Give the user options such as single numbers or letters to enter, rather than them entering in long entries.
CODE:
def display(t,t1,t3,t4,t5,t6):
if t == 1:
print("Coffee Selected:Jonestown Brew\n")
print("Weight of coffee:%f lbs\n" %t1)
else:
print("Coffee Selected:Plymouth Jolt\n")
print("Weight of coffee:%f lbs\n" %t1)
price=coffeeP(t,t1)
print("coffee Cost:$%f" %price)
subtotal=SH(t1,price)
tax(t3,t4, t5, t6,subtotal)
def coffeeP(t, t1):
price = 0.000
if t == 1:
price = 10.50 * t1
else:
price = 16.95 * t1
return price
def SH(t1,price):
cshipping = t1 * 0.93
chandling = 2.50
subtotal=price+cshipping+chandling
print("SHIPPING COST:$%f\n" %cshipping)
print("HANDLING COST:$%f\n" %chandling)
print("Subtotal=coffeeprice+cshipping+chandling=$%f"%subtotal)
return subtotal
def tax(t3,t4, t5, t6,subtotal):
print("shipping state:%s" %t3)
print("shipping city:%s" %t4)
a = ['washington' 'california' 'texas']
b = ['oregon' 'florida']
tax=0.00
ptax=0.00
if t3 in a:
tax = (subtotal * 0.09)
print("Hi")
else:
if t3 in b:
tax = (subtotal * 0)
else:
tax = (subtotal * 0.07)
if t5 == 1:
ptax = tax + 20
print("shipping method:Overnight" )
else:
if t5 == 1:
ptax = tax + 13
print("shipping method:2-day" )
else:
ptax = tax+0
print("shipping method:Standard" )
if t6 == 1:
pt = (subtotal*0.03)
subtotal=subtotal+pt
print("Payment Option:PayPal" )
else:
if t6 == 1:
pt = (subtotal*0.05)
subtotal=subtotal+pt
print("Payment Option:Credit Card" )
else:
pt = (subtotal*0.02)
subtotal=subtotal-pt
print("Payment Option:Check" )
totaltax=ptax+pt+tax
print("total Tax:$%f" %totaltax)
total=subtotal+ptax+tax
print("Total amount to be paid:$%f" %total)
t = int(raw_input("SELECT THE COFFEE TYPE OPTION\n1.Jonestown
Brew\n2.Plymouth Jolt\noption:"))
t1 = float(raw_input("Number of lbs required\nweight:"))
t3 = raw_input("Enter State:")
t3=t3.lower()
t4 = raw_input("Enter City:")
t4=t4.lower()
t5 = int(raw_input("Select Payment
Method\n1.Overnight\n2.2-day\n3.Standard\n\noption:"))
t6 = int(raw_input("Select Payment Method\n1.PayPal\n2.Credit
Card\n3.Check\noption:"))
display(t,t1,t3,t4,t5,t6)
SCREENSHOT:

THANKYOU:)
using Python Create a program that determines the cost of sending out coffee. The Konditorei coffee...