Class Participation Exercise 13
Class Participation Exercise 13
Proper completion of this exercise is considered as part of course participation. An answer will be discussed in class.
Apply the decorator design pattern to represent the structure of a pizza and for calculating its total cost.
Starting with a base (e.g., thick crust), you can decorate with successive toppings (e.g., rich sauce, then pepperoni, then cheese). Each base or topping has a specific incremental cost to add to the total cost.
Draw a UML class diagram that applies the decorator pattern for the structure of the above base and toppings.
Submit your diagram as a PNG file.