Question
#List of prices prices = [] sub_total = 0.0 #Iterate for 5 items for i in range(5): #Get the price value = float( input(Enter the
-
#List of prices prices = [] sub_total = 0.0 #Iterate for 5 items for i in range(5): #Get the price value = float( input("Enter the price of item #" + str(i+1) + ": ")) #compute the sub total sub_total = sub_total + value #add the value to the list prices.append(value) #compute the tax on the sub total @ rate of 7.25% tax = sub_total * (7.25/100) #Now, compute the total price total_price = sub_total + tax print("Sub total: " + str(sub_total)) print("Tax: {:0.2f}".format(tax)) print("Total: {:0.2f}".format(total_price))
//Output
use this this data to answer the question thanks.
Use the bill of materials (BOM) spreadsheet you developed in Question 2 of the Week 3 homework exercise and write a Python program that prompts the user for a number of completed items (cookies, brownies, or whatever your finished product from the Week 3 assignment was).
Once that number is inputted, the program use the BOM to generate a list of detailed ingredients, the amounts required to make that amount of items, and the total cost of all ingredients.
Due Date
11:55 P.M. (Pacific Time), Day 6
Points
100
Grading Category
Mini-Project 2
The output should include:
- a COMPLETE recipe (or a link to the recipe)
- details of the amounts required of each ingredient
- the expected cost of each completed item
- the total cost required to produce the requested amount
There should be an ingredients section followed by the instructions for the recipe (Reference some recipe websites for ideas on the output). Here is an example of an output:
An additional requirement is for you to use a conditional statement (IF, ELIF, , ELSE) in your program. You determine what feature you want to implement in the program to use this requirement. You might consider different prices for bulk orders of ingredients (if you really want to push yourself), reporting to the user something about the number of cookies they are baking, etc. Be creative (it counts for this project).
There are multiple deliverables for this assignment:
bill.py py bill.py b #List of prices 3 prices [ 4 sub total-0.0 6 #Iterate for 5 items 7 for i in range (5): #Get the price value -float( input("Enter the price of item #" + str(1+1) + ": ")) 9 10 #compute the sub total subtotalsubtotal+ value 12 13 #add the value to the list prices.append (value) 15 16 17 #compute the tax on the sub total @ rate of 7.25% 18 tax= subtotal * (7.25/100) 19 20 #Now, compute the total price 21 total price sub total + tax 23 print("Sub total: str (sub_total)) 24 print("Tax: :0.2f}".format (tax) 25 print("Total: f:e.2fj".format (total_price)) 26 bill.py py bill.py b #List of prices 3 prices=[] 4 subtotal 0.0 #Iterate for 5 items for i in range (5): 7 #Get the price value float( input("Enter the price of item #" + s 9 10 #compute the sub total sub total-sub total value 12 13 #add the value to the list prices.append (value) 15 16 17 #compute the tax on the sub total @ rate of 7.25% 18 tax= subtotal * (7.25/100) PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL amoeba@amoeba-w10 MINGN64 /e/ws/vscode/chegg/py (testing) python bill.py Enter the price of item #1: 1.1 Enter the price of item #2: 20.2 Enter the price of item #3: 30.3 Enter the price of item #4 : 40.4 Enter the price of item #5: 50.5 Sub total: 151.5 Tax: 10.98 Total: 162.48 bill.py py bill.py b #List of prices 3 prices [ 4 sub total-0.0 6 #Iterate for 5 items 7 for i in range (5): #Get the price value -float( input("Enter the price of item #" + str(1+1) + ": ")) 9 10 #compute the sub total subtotalsubtotal+ value 12 13 #add the value to the list prices.append (value) 15 16 17 #compute the tax on the sub total @ rate of 7.25% 18 tax= subtotal * (7.25/100) 19 20 #Now, compute the total price 21 total price sub total + tax 23 print("Sub total: str (sub_total)) 24 print("Tax: :0.2f}".format (tax) 25 print("Total: f:e.2fj".format (total_price)) 26 bill.py py bill.py b #List of prices 3 prices=[] 4 subtotal 0.0 #Iterate for 5 items for i in range (5): 7 #Get the price value float( input("Enter the price of item #" + s 9 10 #compute the sub total sub total-sub total value 12 13 #add the value to the list prices.append (value) 15 16 17 #compute the tax on the sub total @ rate of 7.25% 18 tax= subtotal * (7.25/100) PROBLEMS OUTPUT DEBUG CONSOLE TERMINAL amoeba@amoeba-w10 MINGN64 /e/ws/vscode/chegg/py (testing) python bill.py Enter the price of item #1: 1.1 Enter the price of item #2: 20.2 Enter the price of item #3: 30.3 Enter the price of item #4 : 40.4 Enter the price of item #5: 50.5 Sub total: 151.5 Tax: 10.98 Total: 162.48
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started