Question: i need the code for this excercise in c++ with the .H , .CPP and the Test.cpp and also the UML Diagram. Create a class
i need the code for this excercise in c++ with the .H , .CPP and the Test.cpp and also the UML Diagram.
Create a class named Pizza that stores information about a single Pizza. It should contain the following: Private instance variables to store the size of the Pizza (either small, medium, or large), the number of cheese toppings, the number of pepperoni toppings, and the number of ham toppings.
Constructor that set all of the instance variables. Public methods to get and set the instance variables. A public method named calcost() that returns a double that is the cost of the pizza.
Pizza cost is determined by: Small: $10+$2 per topping Medium: $12+$2 per topping Large: $14+$2 per topping
A public method named getDescription() that returns a String containing the pizza size, quantity of each topping, and the pizza cost as calculated by calCost().
Write test code to create several pizzas and output their descriptions. For example, a large pizza with 1 cheese, 1 pepperoni, and 2 ham toppings should cost a total of $22.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
