Question: C++ Create a pizza class that has: 1. Pizza size (small, medium or large) 2. Crust type (pan, thin or hand-tossed) 3. a list of

C++

Create a pizza class that has:

1. Pizza size (small, medium or large)

2. Crust type (pan, thin or hand-tossed)

3. a list of toppings (cheese, pepperoni, onion, sausage, tomatoes etc.) (this could be an array, or a group of boolean values representing whether the topping is on this pizza or not)

You should provide the following member functions:

1. getters and setters for size, crust type, and toppings.

2. You should provide an outputDescription function that lists the information about any given pizza object. This will be a void function that uses cout to display size, crust type, and topping.

3. You should provide a computePrice function that calculates the price of the pizza and returns a double representing the price. Prices are defined as follow:

Small Pizza = $10.00 + $2.00 per topping

Medium Pizza = $14.00 + $2.00 per topping

Large Pizza = $17.00 + $2.00 per topping

After creating the class you should write code in the main() function that will create some pizza objects and exercise each of their methods. Your code in the main method should create a pizza, add toppings, set size etc and then print out that particular pizza.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!