Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python programming # Question 4 # A pizza restaurant requires 200 grams of flour, 10 ml of olive oil, # 100 ml of tomato sauce

python programming
image text in transcribed
image text in transcribed
# Question 4 # A pizza restaurant requires 200 grams of flour, 10 ml of olive oil, # 100 ml of tomato sauce and 200 grams of choose to make one of thoir #basic pizzas. The restaurant's supplier sells bags of flour weighing #5 kg each, drums of olive oil containing 5 litres, cans of tomato #sauce containing 2 litres and bags of grated cheese weighing 1 kg. # Write a program to ask the user how many pizzas they expect to make # in the following week and work out what supplies would need to bought # from the supplier in order to moed the predicted demand. The program should also let the user know what quantities of each ingredient will # be left over at the end of the week. def maino: # Here we set the values of the ingredients required per pizza. # We need to make sure the units are the same as the suppliers flour -2007 10/1000 tomato Sauce /1000 cheese - 1/1000 Here we ask the user for the number of pizzas pizzas "How many pizzas? Here we calculate the quantity of each ingredient needed + (5 - flour) ollNeeded * pizzas ) + (5-oil Mour tomato SauceNeeded - tomato Sauce pizzas) + (2- pizzas) + (1 - cheese) cheeseNeeded - MacBook Air Question Completion Status chooseNeeded pizzas) + (1 - choose # Here we calculate items to be ordered from the supplier bagsOfFlourNeeded = 1 flourNeeded 5) drumsOfOilNeeded 1/5) cansOfTomato SauceNeeded = int(tomato Sauce Needed 2) = int(cheeseNeeded // 1) # Here we work out the quantities left over flourl.eft = (bagsOfFlourNeeded 5) - (flour pizzas) - (drumsOfOilNeeded 5) - (oil. tomato Saucel.eft = (cansOfTomato Sauce Needed "pizzas) cheesel.eft - 1* 1) - (cheese pizzas) # Here we display the number of items to be ordered print(*#* *********") "Bags of four needed: bagsOfFlour Needed) print "Drums of oil needed:", drumsfollNeeded print Cans of tomato sauce needed cansOfTomato Sauce Needed) print("Bags of cheese needed:", print("w") print("Flour left over:", flourl.eft, "kgs") oil loft over:", oilett. "Itrs") print("Tomato sauce left over:", tomato Sauceleft, Itrs) print("Cheese lett." "kgs printen Wwwers # Example Macbook Air

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

More Books

Students also viewed these Databases questions