Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I missed the day we had lecture over this so I\'m in over my head here on this.

ID: 3634746 • Letter: I

Question

I missed the day we had lecture over this so I'm in over my head here on this. Help would be much appreciated and this is due at 11:59 EST 12/2/2011....yup thats in 3 hours and I have thrown in the towel and am asking for help.


Define a class called Pizza that has member variables to track the type of pizza (deep dish, hand tossed, or pan) along with the size (small, medium, or large) and the number of pepperoni or cheese toppings. You can use constants to represent the type and size. Include mutator (set) and accessor (get) functions for your class. Create a void function, outputDescription( ), that outputs a textual description of the pizza object. Also include a function, computePrice(), that computes the cost of the pizza and returns it as a double according to the rules:
• Small pizza = $10 + $2 per topping
• Medium pizza = $14 + $2 per topping
• Large pizza = $17 + $2 per topping
Write a suitable test program that creates and outputs a description and price of various pizza objects.

Explanation / Answer

#include using namespace std; #ifndef PIZZA_H #define PIZZA_H enum Type { DEEP_DISH, HAND_TOSSED, PAN }; enum Size { SMALL, MEDIUM, LARGE }; class Pizza { private: int type; int size; int pepperoniToppings; int cheeseToppings; public: Pizza() :type(0), size(0), pepperoniToppings(0), cheeseToppings(0) { } ~Pizza() { } int getSize() { return size; } int getType() { return type; } int getPepperoniToppings() { return pepperoniToppings; } int getCheeseToppings() { return cheeseToppings; } void setSize(Size s) { size = s; } void setType(Type t) { type = t; } void setPepperoniToppings(int pepperoni) { pepperoniToppings = pepperoni; } void setCheeseToppings(int cheese) { cheeseToppings = cheese; } void outputDescription() { cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote