Question: Pizza making program in Java Implement the following: Design a Cash Register for creating, describing, and costing a pizza. The Cash Register is main. In
Pizza making program in Java Implement the following:
Design a Cash Register for creating, describing, and costing a pizza.
The Cash Register is main. In it there may be only one object of pizza.
There are three sizes of pizza: small, medium and large that cost $10, $12, and $16 respectively
The pizza may come with cheese, pepperoni, sausage, onions, anchovies, mushrooms, costing $2, $2, $2, $1, $1.50, $1.75 respectively
Create a PizzaDecorator class, derived from Pizza. All the ingredients list in 4 are classes derived from PizzaDecorator.
In PizzaDecorator aggregate BasePizza. In the constructor for all the ingredient classes, attach the current outer object in our pizza to the aggregated BasePizza.
Modify the Pizza code from Beachboard so that the BasePizza has only abstract methods double cost() and String desc().
The pizzas ordered may have any number of ingredients and any ingredient may be repeated as much as the customer desires.
The Cash Register should run perpetually.
Create separate Factories for the Pizzas and the Ingredients .
In other words, use the Decorator Design Pattern to implement this program

hat type of Mediun Pizza of Here is a sample pizza: Ingredients: Ingredients costs $19.0 Ingredients epersausage run Sausage epe sauae Mushroons what pizza:l Ingredients: 0 when done 0 when done Mushrooms 0 when done Picked -1 Medium Pizza, cheese coStS $14.0 Ingredients: Picked 5 Large Pizza, Anchovies costs choice: Picked5 Mediun Pizza, Ingredients: po sausage Anchovies costs $20.5 0 when done Ingredients: choice: . Onions Anchovies Picked 1 small pizt.0 Cheese costs $12.0 Ingredients: 0 when done 0 when done Picked 2 Mediun Pizza, Cheese, Pepperon costs s16 Pepperoni Mushroom:s 0 when done Picked S Large Pizza, Anchovies, Anchovies costs $19.0 Ingredients: 3Sausage choice: Picked Mediun Pizza 0 when done . onions Anchovies Mushroons costs choice: 3. Sausage . Onions Picked 2 Small pizza, Cheese costs $14 Ingredients: Anchovies Ingredients Anchovies 0 when done . Sausage 4. Onions 0 when done Ficked 3 Mediun Pizza, Cheese, Pepperoni Pepperon choi ce: 3. Sausage Anchovies Picked 5 Large Pizza. Nushroons usage costs ingredients: Anchovies 0 when done Anchovies costs 0 when done Pepperoni Picked-0 Mediun Pizza, Cheese, Pepperoni Ingredients: choice: Picked-0 age, Onions mall pizza Onions costs S1 Mushroons 0 when done Anchovies 0 when dane Large Picked
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
