Project: The Pizza-Party Bill

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:

  1. pizzas is how many pizzas you order.
  2. pizzaPrice is the price of one pizza, in dollars.
  3. delivery is the delivery fee for the whole order, in dollars.
  4. people is how many people split the bill, you included.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.