In: Computer Science
Solution:
code:
import math numOfPizzas = int(input('Enter number of pizzas required for the coming week: ')) quanFlour= numOfPizzas*200 quanOil= numOfPizzas*10 quanSauce= numOfPizzas*100 quanCheez= quanFlour numPacketFlour= math.ceil(quanFlour/5000) print("Quantity of flour required is: %d" % numPacketFlour) numPacketOil= math.ceil(quanOil/5000) print("Quantity of Olive oil required is: %d" % numPacketOil) numPacketSauce= math.ceil(quanSauce/2000) print("Quantity of flour required is: %d" % numPacketSauce) numPacketCheez= math.ceil(quanCheez/1000) print("Quantity of flour required is: %d" % numPacketCheez) print("Quantity left after end of the week: ") print("Flour: %d gram, Oil: %d ml, Sauce: %d ml, Cheez: %d gram" % ((quanFlour%5000), (quanOil%5000), (quanSauce%2000), (quanCheez%1000)))
output:
Hit the thumbs up if you liked the answer. :)