FUNCTIONS & CONDITIONALS
Pizzeria Order Calculator
Build an example pizza order and see how the quantity, pizza type and delivery rules affect its total.
Your order
Order total
Choose your order details, then calculate the total.
Example prices are in South African rand. Delivery costs R30, or is free on birthdays and for orders over R150 in Johannesburg. This page calculates prices only; it does not place an order.
How it works
Choose a quantity, pizza type and delivery location to calculate an example order. No order is sent.
One function calculates the pizza cost; another checks the delivery rules. The script validates the quantity and adds the two amounts to display the total.
Concepts: Functions, conditionals, number validation and price calculations.