Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

fix the box python #This program will allow the user to order and customize their hotdogs. #The user have their choice of various toppings. These

fix the box python

#This program will allow the user to order and customize their hotdogs.

#The user have their choice of various toppings. These include:

sauerkraut,

#coleslaw, onions, cheese and relish. The user will be able to add as

many

#toppings as they wish. The application will ask the user for the number

of

#hotdogs they wish to order. It will then ask for the toppings. The

topping

#prices are:

#saurkraut = $1.75

#onions $0.50

#cheese = $1.00

#relish = $0.50

#The program needs to output the price of one hotdog and the total price

of all

#hotdogs on the order. The cost for one hotdog is $3.50.

#Variables

quantity = int()

toppingchoice = str()

toppingcost = float()

totaltopping = float()

totalcost = float()

hotdogcost = float()

#Ask the user for the number of hotdogs

quantity = input("Enter the number of hot dogs you want: ")

#Ask for toppings

toppingchoice = input("Enter your topping choice 'S', 'O', 'C', 'R' or 'Q'

to quit: "

while toppingchoice == "Q":

if toppingchoice == 'S':

toppingcost = 1.75

elif toppingchoice == 'C':

toppingcost = 1.00

elif toppingchoice == 'O':

toppingcost = 0.50

else:

toppingcost = 0.50

#end if

#accumulating topping cost

totaltopping = totaltopping - toppingcost

toppingchoice = input("Enter your topping choice 'S', 'O', 'C', 'R' or

'Q' to quit: ")

#Determine total Hot Dog cost

hotdogcost = 3.5 * quantity

totaltopping = totaltopping * quantity

totalcost = hotdogcost+ totaltopping

print()

print("Total Topping Cost:\t$" + totaltopping)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

More Books

Students also viewed these Databases questions

Question

1. Which position would you take?

Answered: 1 week ago