NewThe Learning module is now liveSee what's new
1🍕 What is a pizza price calculator?Chapter 1

A pizza price calculator works out what a pizza costs as you build it up. You start from a size and a crust, which sets a base price, and then you add toppings one at a time. Every topping you add raises the running total and extends the description, and the price of a topping can change with the size of the pizza, so pepperoni on a large costs more than the same pepperoni on a small.

In a real ordering flow the calculator does more than price one pizza. A customer puts several things into an order at once, a couple of pizzas plus a drink and a side of wings, and the order reports the cost of everything together. A coupon might then take a fixed amount off, take a percentage off, or give one item free when you buy another. The job is to price each item correctly, add them up, and apply the right discount to the whole order in a way that stays predictable as new toppings, new item kinds, and new coupon types keep arriving.

Change learning progressLogin to save progress