You’ve named values, calculated with them, and built messages with template literals. In the trip budget lesson, you also worked out expected results before trusting a script. This project puts all of that together in one small program you could actually use the next time friends come over.
You’re hosting a pizza party. You order the pizzas, pay the delivery driver, and then everyone chips in the same amount. Your program works out the bill and writes the message for the group chat. In this brief, you’ll read the requirements, work out two bills by hand, and plan your steps. In the next item, you’ll write the code on-site and let the tests check it.
Read the Brief
Every pizza in an order costs the same, and you pay the delivery fee once per order, not per pizza. Everyone at the party pays an equal share, you included. All amounts are whole dollars.
Your function is called partyBill(). As in the earlier exercises, the platform calls it and supplies the inputs—four whole numbers—always in this order:
pizzasis how many pizzas you order.pizzaPriceis the price of one pizza, in dollars.deliveryis the delivery fee for the whole order, in dollars.peopleis how many people split the bill, you included.