Predict
New Coder
that's the question and the code beneath
(Total Purchase) A customer in a store can purchase any one of the five items listed below: The prices of the five items are:
Price of item 1 = 12.95
Price of item 2 = 24.95
Price of item 3 = 6.95
Price of item 4 = 14.95
Price of item 5 = 24.95
Write a program that prompts the user to enter the quantity and item # of the product being bought. You should then calculate and print the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6% (declared as a constant).
item1 = (12.95)
item2 = (24.95)
item3 = (6.95)
item4 = (14.95)
item5 = (24.95)
SALES_TAX = .06
choice = int(input("Enter an item: item1, item2, item3, item4, item5\n"))
quantity = input("Enter quantity: ")
quantity = float(quantity)
item_no = input("Enter item number: ")
item_no = float(item_no)
while True:
if choice == float(item1):
choice = int(input('Would you like to pick another order? y/n\n'))
if choice == 'y':
choice = int(input("Enter item1 again: "))
else:
subtotal = quantity * choice
SALES_TAX = subtotal*SALES_TAX
total = subtotal + SALES_TAX
print ("your subtotal is: ",subtotal )
print ("your sales tax is: ", SALES_TAX )
print ("your total is: ", total )
(Total Purchase) A customer in a store can purchase any one of the five items listed below: The prices of the five items are:
Price of item 1 = 12.95
Price of item 2 = 24.95
Price of item 3 = 6.95
Price of item 4 = 14.95
Price of item 5 = 24.95
Write a program that prompts the user to enter the quantity and item # of the product being bought. You should then calculate and print the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6% (declared as a constant).
item1 = (12.95)
item2 = (24.95)
item3 = (6.95)
item4 = (14.95)
item5 = (24.95)
SALES_TAX = .06
choice = int(input("Enter an item: item1, item2, item3, item4, item5\n"))
quantity = input("Enter quantity: ")
quantity = float(quantity)
item_no = input("Enter item number: ")
item_no = float(item_no)
while True:
if choice == float(item1):
choice = int(input('Would you like to pick another order? y/n\n'))
if choice == 'y':
choice = int(input("Enter item1 again: "))
else:
subtotal = quantity * choice
SALES_TAX = subtotal*SALES_TAX
total = subtotal + SALES_TAX
print ("your subtotal is: ",subtotal )
print ("your sales tax is: ", SALES_TAX )
print ("your total is: ", total )