Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Welcome!\n")
- while True:
- brand = int(input("Please select the mattress brand (1 - Sealy, 2 - Simmons): "))
- if brand == 1 or brand == 2:
- break
- print("Invalid brand name!")
- if brand == 1:
- while True:
- size = input("Please select the size (K - King, Q - Queen, T - Twin): ").upper()
- if size in ["K", "Q", "T"]:
- break
- print("Invalid size!")
- while True:
- comfort = input("Please select the comfort level (M - Medium, F - Firm, E - Extra Firm): ").upper()
- if comfort in ["M", "F", "E"]:
- break
- print("Invalid comfort level!")
- else:
- while True:
- size = input("Please select the size (K - King, Q - Queen, F - Full): ").upper()
- if size in ["K", "Q", "F"]:
- break
- print("Invalid size!")
- while True:
- comfort = input("Please select the comfort level (C - Cushion Firm, F - Firm, E - Extra Firm): ").upper()
- if comfort in ["C", "F", "E"]:
- break
- print("Invalid comfort level!")
- while True:
- spring = input("Do you like to have box springs (Y - Yes, N - No)? ").upper()
- if spring in ["Y", "N"]:
- break
- print("Invalid input!")
- while True:
- delivery = input("Which shipping mode do you like (S - Standard, N - Next Day)? ").upper()
- if delivery in ["S", "N"]:
- break
- print("Invalid input!")
- code = input("Promotion code: ").upper()
- if brand == 1:
- name = "Sealy, "
- if size == "K":
- name += "King Size, "
- box = 400
- if comfort == "M":
- cost = 1800
- elif comfort == "F":
- cost = 2200
- elif comfort == "E":
- cost = 2400
- elif size == "Q":
- name += "Queen Size, "
- box = 300
- if comfort == "M":
- cost = 1400
- elif comfort == "F":
- cost = 1800
- elif comfort == "E":
- cost = 2000
- elif size == "T":
- name += "Twin Size, "
- box = 100
- if comfort == "M":
- cost = 900
- elif comfort == "F":
- cost = 1300
- elif comfort == "E":
- cost = 1500
- elif brand == 2:
- name = "Sealy, "
- if size == "K":
- name += "King Size, "
- box = 400
- if comfort == "C":
- cost = 2000
- elif comfort == "F":
- cost = 2500
- elif comfort == "E":
- cost = 3000
- elif size == "Q":
- name += "Queen Size, "
- box = 300
- if comfort == "C":
- cost = 1400
- elif comfort == "F":
- cost = 1900
- elif comfort == "E":
- cost = 2400
- elif size == "F":
- name += "Full Size, "
- box = 200
- if comfort == "C":
- cost = 1000
- elif comfort == "F":
- cost = 1500
- elif comfort == "E":
- cost = 2000
- if comfort == "C":
- name += "Cushion Firm:"
- elif comfort == "F":
- name += "Firm:"
- elif comfort == "E":
- name += "Extra Firm:"
- elif comfort == "M":
- name += "Medium:"
- print("===============Order Summary====================")
- print(name)
- if cost >= 1000:
- print(f'Mattress: ${"{:,.2f}".format(cost)}')
- else:
- print(f'Mattress: $ {"{:,.2f}".format(cost)}')
- if spring == "Y":
- print(f'Box springs: $ {"{:,.2f}".format(box)}')
- if code == "SLEEP":
- dis = (cost+box)/10
- sub = cost + box - ((cost+box)/10)
- else:
- sub = cost + box
- else:
- if code == "SLEEP":
- dis = cost/10
- sub = cost - ((cost) / 10)
- else:
- sub = cost
- if dis<100:
- print(f'Discount: $ -{"{:,.2f}".format(dis)}')
- else:
- print(f'Discount: $ -{"{:,.2f}".format(dis)}')
- if sub >= 1000:
- print(f'Subtotal: ${"{:,.2f}".format(sub)}')
- else:
- print(f'Subtotal: $ {"{:,.2f}".format(sub)}')
- if delivery == "S":
- deli = 100
- print("Standard shipping: $ 100.00")
- else:
- deli = 300
- print("Next-day shipping: $ 300.00")
- tax = sub * 0.0625
- if tax <100:
- print(f'Tax: $ {"{:,.2f}".format(tax)}')
- else:
- print(f'Tax: $ {"{:,.2f}".format(tax)}')
- print("------------------------------------------------")
- total = sub + deli + tax
- if total >=1000:
- print(f'Total: ${"{:,.2f}".format(total)}')
- else:
- print(f'Total: $ {"{:,.2f}".format(total)}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement