Question: The program completed in python should either print the name and price for a coffee add - in from the Jumpin Jive coffee shop or
The program completed in python should either print the name and price for a coffee addin from the Jumpin Jive coffee shop or it should print the message Sorry, we do not carry that. I keep getting the following error. What am i doing wrong?
Status: FAILED!
Check:
Test: Add no ingredients
Reason: Unable to find in the program's output.
Enter coffee addin or XXX to quit: Order total is: $
Error : AssertionError
My code is:
# JumpinJive.py This program looks up and prints the names and prices of coffee orders.
# Input: Interactive.
# Output: Name and price of coffee orders or error message if addin is not found.
# Initialize variables.
NUMITEMS
# Initialized list of addins.
addIns Cream "Cinnamon", "Chocolate", "Amaretto", "Whiskey"
# Initialized list of addin prices.
addInPrices
orderTotal # All orders start with a charge
# Get user input.
addIn inputEnter coffee addin or XXX to quit:
# Write the rest of the program here.
foundIt False
while addIn XXX:
for drink in rangeNUMITEMS:
if addInsdrink addIn:
foundIt True
print addInsdrink "Price is $ addInPricesdrink
orderTotal addInPricesdrink
if not foundIt:
printSorry we do not carry that."
orderTotal orderTotal
addIn inputEnter coffee addin or XXX to quit:"
foundIt False
printOrder total is $ orderTotal
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
