Question: In this question, we will model a simple ordering application for an ice cream store. In our cream store, we will have the base ice
In this question, we will model a simple ordering application for an ice cream store. In our cream
store, we will have the base ice cream class, which has two attributes flavor and price It also supports
two methods
getDescription that prints out the flavor of the ice cream
getCost that prints out cost of the ice cream
Our application supports the decoration of the base ice cream by adding extra toppings to the ice cream.
Suppose we have two toppings sprinkles and nuts now and will extend it for more toppings in the
future. Each decorator modifies the description or cost of the ice cream without changing the basic ice
cream class. After adding the toppings, the getDescription method should print out the flavor as well as
the topping information. The getPrice method should include the cost of toppings to the total price.
Part : Provide a UML Class diagram showing essential classes, dependencies, attributes, and operations
in your design by following the design pattern you selected. If necessary, add a description to make sure
the diagram can be easily understood by another person while keeping it as short as possible.
Part : Implement your application using Java or C In your implementation, please provide an
executable demo that shows how two toppings are added and getDescription and getCost methods
work correctly.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
