Write the program in Python Ms. Binny went to the automated Bins Supermarket where, on entering the supermarket, one views the produce on a screen and selects the bin number of the bin containing the...





Write  the program in Python


Ms. Binny went to the automated Bins Supermarket where, on entering the supermarket, one views the produce on a screen and selects the bin number of the bin containing the desired produce and then enters the quantity of the produce desired. After selecting everything that is needed, the shopper proceeds to the check out where the bill and the selected bagged produce are ready.


Write a Python program that




  • given the two lists as shown below, produce and prices, where the price of the produce is listed at the


    corresponding index to the produce bin/name (for example, the bag of carrots is listed at index 0 in the produce list and the price of the bag of carrots is listed at index 0 in the prices list)


    produce = ["Bin 1: Bag of Apples", "Bin 2: Banana Bunch", "Bin 3: Pears", "Bin 4: Bag of Carrots", "Bin 5: Cauliflower", "Bin 6: Broccoli", "Bin 7: Red Bell Pepper", "Bin 8: Green Onions", "Bin 9: Packaged Okra", "Bin 10: Oranges"] prices = [5.50, 2.60, 0.80, 3.25, 3.99, 3.35, 1.35, 1.10, 4.50, 0.80]


  • shows the shopper their options and then obtains from the shopper the bin numbers and the quantities of the produce they wish to purchase (both the bin number and quantity are integers),




  • computes the cost of the produce bought, appends the three pieces of information in a new list called shoppingCart which holds the bin number followed by the quantity and then the cost of the produce for each item purchased, and




  • creates and prints the bill as shown in the output, including the total


    Sample input/output is as follows:


    Bin 1: Bag of Apples {$5.50} Bin 2: Banana Bunch {$2.60} Bin 3: Pears {$0.80}







Bin 4: Bag of Carrots {$3.25} Bin 5: Cauliflower {$3.99} Bin 6: Broccoli {$3.35} Bin 7: Red Bell Pepper {$1.35} Bin 8: Green Onions {$1.10} Bin 9: Packaged Okra {$4.50} Bin 10: Oranges {$0.80} Do you wish to start filling your shopping cart? (yes/done) yes Enter the bin number (e.g., enter 3 for Pears): 4 Enter the quantity of the selected produce: 2 Do you wish to continue shopping? (yes/done) yes Enter the bin number (e.g., enter 3 for Pears): 8 Enter the quantity of the selected produce: 5 Do you wish to continue shopping? (yes/done) yes Enter the bin number (e.g., enter 3 for Pears): 6 Enter the quantity of the selected produce: 1 Do you wish to continue shopping? (yes/done) done Bin Num Quantity Total Cost 4 2 6.50 8 5 5.50 6 1 3.35 The total bill is $ 15.35


Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here