In this exercise you're working at a pizza place that delivers to customers.
You offer three types of pizzas:
Customers can also choose two additional options for a small additional fee:
When customers place an order, an additional fee is added if they only order one or two pizzas:
You have three tasks, each of which will work with pizzas and their price.
Define the Pizza custom type to represent the different types of pizzas and options:
MargheritaCapreseFormaggioExtraSauceExtraToppingsExtraSauce and ExtraToppings should wrap the Pizza type.
Implement the pizza_price function to calculate a pizza's price:
pizza_price(Caprese)
// -> 9Implement the order_price function to calculate a pizza order's price:
order_price([Margherita, Formaggio])
// -> 19In this exercise you're working at a pizza place that delivers to customers.
You offer three types of pizzas:
Customers can also choose two additional options for a small additional fee:
When customers place an order, an additional fee is added if they only order one or two pizzas:
You have three tasks, each of which will work with pizzas and their price.
Define the Pizza custom type to represent the different types of pizzas and options:
MargheritaCapreseFormaggioExtraSauceExtraToppingsExtraSauce and ExtraToppings should wrap the Pizza type.
Implement the pizza_price function to calculate a pizza's price:
pizza_price(Caprese)
// -> 9Implement the order_price function to calculate a pizza order's price:
order_price([Margherita, Formaggio])
// -> 19