Pizza Calculator Practice

Your job is to create an app that helps people know how many pizzas to order.

You are given a function that has an algorithm for how many pizzas to order per person.

You need to set up an event listener, so that when you click the button "Calulate Total Pizzas for 7 People", then you it will call

    addPizzas(7);

Then, you will need to complete the addPizzas() function, so that it will create a .pizza div and append it to the #pizzas div for each pizza needed. (see the TODO comments for more information).

Food for Thought

  • What happens when you click the button multiple times? How can you fix that?
  • How can you adjust this to be dynamic, and calculate the total amount of pizzas for any number of people?