Problem set 3 has three parts as shown below. You may submit joint work with a partner. Include both partners' names on each part of the assignment.
|What is it
||How to submit it
||2.2.(3,8,9), 2.4.(14,15), 2.B*
||Submit via the online autotester.
Partners may submit under one username.
|Data modeling exercise**
||Submit an SML file here on Canvas.
Partners should submit one joint copy.
Submit on paper. Partners should submit one joint paper.
* To clarify, project 2.B is an optional extra credit problem. You can find it at the end of section 2.6. When you submit your code to the autotester, include copies of all supporting functions from the textbook, as well as your new function(s).
If you want to gain more experience with lists, you may also try project 2.F. There is not an autotester for this project; instead submit your code here on Canvas for me to read.
** Our new knowledge of lists in SML allows us to accurately model custom pizzas with multiple toppings.
Consider the following datatype definitions based on the Sweet Basil Pizzeria menu:
datatype topping = Pepperoni | Ham | Sausage | Chicken | Bacon | Salami
| Mushroom | Onion | BellPepper | Garlic | Olives | ArtichokeHearts
| SunDriedTomatoes | Jalapeno | Pineapple | Basil | Spinach
| GreenOlives | KalamataOlives | RoastedRedPepper | Ricotta | Feta;
datatype customPizza = CustomPizza of topping list;
Write a function
price that takes a
customPizza and returns its price as a
real. A cheese pizza costs $19.00, as does a pizza with any one topping. Each additional topping increases the price by $1.50.