Question: import math # Step 1 : Read inputs num _ people = int ( input ( ) ) avg _ slices _ per _ person
import math # Step : Read inputs numpeople intinput avgslicesperperson floatinput costperpizza floatinput # Calculate the total number of slices needed totalslicesneeded numpeople avgslicesperperson # Calculate the number of whole pizzas needed slices per pizza numpizzas math.ceiltotalslicesneeded # Calculate the cost for all pizzas costofpizzas numpizzas costperpizza # Step : Calculate the sales tax tax costofpizzas # Calculate the delivery charge of cost including tax deliverycharge costofpizzas tax # Step : Calculate the total cost totalcost costofpizzas tax deliverycharge # Output the results printfPizza Night Party numpizzas Pizzas: $costofpizzas:f Tax: $tax:f Delivery: $deliverycharge:f Total: $totalcost:f
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
