1 answer

5 5 - Parallel Arrays in Python Mind Tap - Cengage Lea x + V A...

Question:

5 5 - Parallel Arrays in Python Mind Tap - Cengage Lea x + V A https//ng.cengage.com/static/nb/ui/evo/index.html?deploymentid

5 5 - Parallel Arrays in Python Mind Tap - Cengage Lea x + V A https//ng.cengage.com/static/nb/ui/evo/index.html?deploymentid=5745322406056533358933471518eISBN=9781337274509&id=586434 145&snapshotld: L x ... € → O 1 » CENGAGE MINDTAP Q Search this course x Parallel Arrays in Python D Parallel Lists Jumpinjive.py + > Terminal + 1 # Jumpin Java.py - This program looks up and prints the names and prices of coffee orders. 2 # Input: Interactive 3 # Output: Name and price of coffee orders or error message if add in is not found sure you understand it. 2. Write the code that searches the list for the name of the add-in ordered by the customer. 3. Write the code that prints the name and price of the add-in or the error message, and then write the code that prints the cost of the total order. 4. Execute the program using the following data and verify that the output is correct: 5 # Declare variables. 6 NUM_ITEMS - 5 # Named constant 8 # Initialized list of add-ins 9 addins = ["Cream", "Cinnamon", "Chocolate", "Amaretto", "whiskey"] 11 # Initialized list of add-in prices 12 addinPrices = [.89, .25, .59, 1.50, 1.75] 13 found It = False # Flag variable 14 order Total = 2.00 # All orders start with a 2.00 charge 16 # Get user input 17 addin = input("Enter coffee add-in or XXX to quit: ") Cream Caramel Whiskey chocolate Chocolate Cinnamon Vanilla 19 # Write the rest of the program here. Grading When you have completed your program, click the Submit button to record your score. Type here to search A 4 11:04 PME 127/2019 23

Answers

If you have any doubts, please give me comment...

# JumpinJava.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 add-in is not found

# Declare variables.

NUM_ITEMS = 5 # Named constant

# Initialized list of add-ins

addIns = ["Cream", "Cinnamon", "Chocolate", "Amaretto", "Whiskey"]


# Initialized list of add-in prices

addInPrices = [.89, .25, .59, 1.50, 1.75]

foundIt = False # Flag variable

orderTotal = 2.00  # All orders start with a 2.00 charge

# Get user input

addIn = input("Enter coffee add-in or XXX to quit: ")

#check whether entered string is exit or search word

while addIn!="XXX":

    foundIt = False

    # check in the range list elements

    for i in range(NUM_ITEMS):

        if addIns[i].lower()==addIn.lower():

            foundIt = True

            #Name and price of coffee orders

            print("Name:",addIns[i],"price of coffee", addInPrices[i])

            orderTotal += addInPrices[i]

    if foundIt==False:

        #error message if add-in not in list

        print("Name:",addIn," not found")

    addIn = input("Enter coffee add-in or XXX to quit: ")

print("Order total", orderTotal)

print("You choose exit. Thank you")

nagarajuanagaraju-Vostro-3550:07122019$ python3 Jumpinjava.py Enter coffee add-in or XXX to quit: Cream Name: Cream price of

.

Similar Solved Questions

1 answer
You contribute $1,000 annually to a retirement account for eight years and stop making payments at...
You contribute $1,000 annually to a retirement account for eight years and stop making payments at the age of 25. Your twin brother (or sister . . . whichever applies) opens an account at age 25 and contributes $1,000 a year until retirement at age 65 (40 years). You both earn 10 percent on your inv...
1 answer
2. Draw 1,2-difloro-3-ethylcyclobutane in skeleton form. 3. Answer the following questions. a. Which substance has the...
2. Draw 1,2-difloro-3-ethylcyclobutane in skeleton form. 3. Answer the following questions. a. Which substance has the higher boiling point? Hexane or Pentane b. Does a saturated hydrocarbon have the maximum number of H atoms on a molecule? True or False c. Alkynes have double bonds between carbon a...
1 answer
How might transferring specific genes from legumes into rice plants help reduce malnutrition?
How might transferring specific genes from legumes into rice plants help reduce malnutrition?...
5 answers
Mayan kings and many school sports teams are named for the puma, cougar, or mountain lion...
Mayan kings and many school sports teams are named for the puma, cougar, or mountain lion Felis concolor, the best jumper among animals. It can jump to a height of 10.4 ft when leaving the ground at an angle of 47.5...
1 answer
Business Calculators Inc. will pay an annual dividend of $2.25 per share next year. The company...
Business Calculators Inc. will pay an annual dividend of $2.25 per share next year. The company just announced that future dividends will be increasing by 0.75 percent annually. How much are you willing to pay for one share of this stock if you require a rate of return of 12.25 percent? Multiple Cho...
1 answer
Question 6 1 pts At Boca Raton Regional Hospital, 50 patients were seen in the emergency...
Question 6 1 pts At Boca Raton Regional Hospital, 50 patients were seen in the emergency room on April 1. Of those patients, 20 patients were diagnosed with high blood pressure, and 14 patients complained of migraines. There were five patients with both conditions. How many patients seen in the ER h...
1 answer
Which of the following statements are true in regards to the following reaction coordinate diagram? Free...
Which of the following statements are true in regards to the following reaction coordinate diagram? Free Energy AE AE AE4 ΔΕ Progress of Reaction O There will be a higher concentration of reactants than products at equilibrium. okey > 1 The reactants are more stable than the product...
1 answer
Donovan's $200,000 CD matures. He deposits $20,000 into his checking account, buys a CD for $150,000,...
Donovan's $200,000 CD matures. He deposits $20,000 into his checking account, buys a CD for $150,000, and puts $30,000 into his money-market mutual fund. How does this affect M1 and M2? Please show step by step on how to solve....
1 answer
A pension fund manager is considering three mutual funds. The first is a stock fund, the...
A pension fund manager is considering three mutual funds. The first is a stock fund, the second is a long-term government and corporate bond fund, and the third is a T-bill money market fund that yields a rate of 8%. The probability distribution of the risky funds is as follows: Expected Return ...
1 answer
A Moving to another question will save this response. Question 21 Predict the product for the...
A Moving to another question will save this response. Question 21 Predict the product for the following reaction sequence. о H2O* 1. NaOCH2CH3 2. CH3CH2CH2! о о НО НО || III ОН 1 IV A II ООООО В. І с...
1 answer
5 What is Wilson's fxed 8599 a. 1.60 b. 2.50 0.25 d. 0.50 (05-7) Karp Inc....
5 What is Wilson's fxed 8599 a. 1.60 b. 2.50 0.25 d. 0.50 (05-7) Karp Inc. disclosed: "If the FIFO (first-in, first-out) method had been in use, inventories would have been $155 million, $117 million higher than reported on December 31, 2009 and 2008 respectively. Karp's balance sheet...
1 answer
1. What is a situation where a hypothesis test might help make a decision?    Find an...
1. What is a situation where a hypothesis test might help make a decision?    Find an example and cite your source. If it is your own example, please save it for your reflection paper (see the announcement in week 5). You can use any source including your textbook. The purpose of this...
1 answer
Question 1 of 33 > >> A Moving to another question will save this response. 3...
Question 1 of 33 > >> A Moving to another question will save this response. 3 points Save Answer Assessment Tools used for DNA analysis in samples include: O a. Slot Blots, Yield Gels, Digest Gels and Product Gels b. Slot Blots, Renaturation Curves, and Mass Spec Slot Blots, Digest Gells, a...
1 answer
A large corporation is interested in determining whether a relationship exists between the commuting time of...
A large corporation is interested in determining whether a relationship exists between the commuting time of its employees and the level of stress-related problems observed on the job A study of 116 assembly line workers reveals the following Stress Level Commuting High Moderate LOW Total Time Under...
1 answer
For the circuit Figure 5: V = 480220° V, Zline = 0.14+j0.22 2. Zoad = 5+j3...
For the circuit Figure 5: V = 480220° V, Zline = 0.14+j0.22 2. Zoad = 5+j3 22 Determine the current through the circuit, the voltage across the line, the voltage across the load, the real power of the source, line and load, the reactive power of the source, line and load, and the apparent power ...
1 answer
19. An electrical motor with rated values of 15 HP, 890 Tpm develops a torque of...
19. An electrical motor with rated values of 15 HP, 890 Tpm develops a torque of 25 Nm at 1260 rpm motor speed. Calculate the following: (a) pu speed npu_? (b) pu Torque Tpu? (c) pu power Pp?...
1 answer
Personnel tests are designed to test a job​ applicant's cognitive​ and/or physical abilities. A particular dexterity...
Personnel tests are designed to test a job​ applicant's cognitive​ and/or physical abilities. A particular dexterity test is administered nationwide by a private testing service. It is known that for all tests administered last​ year, the distribution of scores was approximatel...
1 answer
2. Design a circuit that outputs 0 if the two 4-bit numbers input are not equal...
2. Design a circuit that outputs 0 if the two 4-bit numbers input are not equal and outputs 1 if they are equal....