Advertisement
jesgaon

2.15 LAB*: Program: Pizza party weekend

Feb 18th, 2025
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. import math
  2.  
  3. # Type your code here.
  4. totalPeople = input()
  5. averageSlices = input()
  6. pizzaCost = input()
  7.  
  8.  
  9. totalPeople1 = int(totalPeople)
  10. averageSlices1 = float(averageSlices)
  11. pizzaCost1 = float(pizzaCost)
  12.  
  13.  
  14. wholePizza = 8
  15. # solving equations
  16. totalSlices = averageSlices1 * totalPeople1;
  17.  
  18. # total pizzas
  19. totalPizza = totalSlices / wholePizza;
  20.  
  21.  
  22. # round pizza using ceil function
  23. roundPizza = math.ceil(totalPizza)
  24.  
  25. # pizza price
  26. pizzaPrice = roundPizza * pizzaCost1;
  27. print('Friday Night Party')
  28. print(f'{roundPizza} pizzas: ${pizzaPrice:.2f}')
  29.  
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement