Create a class Pizza which consists of a dynamically allocated array of Ingredient object pointers.

Abstract- Pizza
Implement a program that creates pizzas based on user order. First, create class called
Ingredient with one instance variable description of type string which is set in the constructor
and can be get using a getter function. Create the following classes that derive from Ingredient:
TomatoSauce, Cheese, Dough, and Pepperoni; each with a constructor that passes the
description argument to the base constructor. Use proper access modifiers!
Create a class Pizza which consists of a dynamically allocated array of Ingredient object pointers.
The constructor expects the number of maximum ingredients as int which is
used to dynamically allocate and initialize the array. Implement a destructor that deletes the
Ingredient objects and the array. The class has a function void add which adds an ingredient to the pizza and a function to print its ingredients to the console.
Create an abstract class Pizza Factory with a pure virtual function called bake() that returns a Pizza* object pointer. Create the two subclasses Cheese Pizza Factory and
Pepperon iPizza Factory which both explicitly override the bake() function. Both functions should remain virtual. The Cheese Pizza Factory instantiates Pizza and adds Dough, Tomato Sauce, and Cheese to it. The Pepperon iPizza Factory creates a pizza and adds all ingredients including pepperoni to it.
Use the following main method which prompts a user to order a type of pizza and then instantiates the corresponding Pizza Factory for it. After the pizza is created by calling the bake() function, the ingredients of the pizza are printed by calling the listIngredients() function of the pizza object. Finally, the factory and the pizza objects are deleted

Last Completed Projects

topic title academic level Writer delivered
© 2020 EssayQuoll.com. All Rights Reserved. | Disclaimer: For assistance purposes only. These custom papers should be used with proper reference.