Question: Need Class Diagram Assignment # 6 - Pizza Restaurant Write a C + + program ( define a class called Pizza ) that has member
Need Class Diagram
Assignment # Pizza Restaurant
Write a program define a class called Pizza that has member variables to track the
type of pizza Deep Dish, HandTossed Pizza, Original PanPizza or Thin N Crispy along
with the size Small Medium, or Large and the toppings Meat toppings Pepperoni
Italian Sausage, Bacon, Ham, Mushroom, Grilled Chicken, Beef, Pork and Veggies
toppingsMushroom Red Onions, Black Olives, Green Peppers, Tomates
Based on the problem, you need to design the program as follows:
Use constants to represent the type and size.
Include mutatorsetter and accessorgetter functions for your class.
Create a void function, output Description that outputs a textual description of
the pizza object.
Also include a function, compute Price that computes the cost of the pizza and
returns it as a double according to the following rules:
Small pizza $$ per topping
Medium pizza $$ per topping
Large pizza $$ per topping
After the order of the pizza has been inputted, describe the order in format of a
billreceipt of purchase which will describe the type of pizza with the price, size of
pizza with the price, the toppings that the customer order with the price describe in
line and Total amount.
code:
#include
#include
#include
using namespace std;
Declare all constants
const string TYPESTUFFCRUST "StuffCrust";
const string TYPEHANDTOSSED "HandTossed Pizza";
const string TYPEPANPIZZA "Original PanPizza";
const string SIZESMALL "Small";
const string SIZEMEDIUM "Medium";
const string SIZELARGE "Large";
const int PRICESMALL ;
const int PRICEMEDIUM ;
const int PRICELARGE ;
const int PRICETOPPINGS ;
Pizza class
class Pizza
private:
string type;
string size;
vector toppings;
double getBasePrice const
double price ;
if getSize SIZESMALL
price PRICESMALL;
else if getSize SIZEMEDIUM
price PRICEMEDIUM;
else if getSize SIZELARGE
price PRICELARGE;
return price;
double getToppingsPrice const
return toppings.size PRICETOPPINGS;
public:
Pizza;
void setTypestring t
type t;
string getType const
if type S
return TYPESTUFFCRUST;
else if type H
return TYPEHANDTOSSED;
else if type P
return TYPEPANPIZZA;
return ;
void setSizestring s
size s;
string getSize const
if size S
return SIZESMALL;
else if size M
return SIZEMEDIUM;
else if size L
return SIZELARGE;
else
return ;
void addToppingsstring topping
toppings.pushbacktopping;
string getToppingNamestring toppingLetter
string toppingName;
if toppingLetter P
toppingName "Pepperoni";
else if toppingLetter M
toppingName "Mushroom";
else if toppingLetter S
toppingName "Sausage";
else if toppingLetter O
toppingName "Onions";
else if toppingLetter B
toppingName "Bacon";
else if toppingLetter BO
toppingName "Black Olives";
else if toppingLetter H
toppingName "Ham";
else if toppingLetter BP
toppingName "Bell Pepper";
else if toppingLetter GC
toppingName "Grilled Chicken";
else if toppingLetter T
toppingName "Tomatoes";
else if toppingLetter BF
toppingName "Beef";
else if toppingLetter PI
toppingName "Pineapple";
else
toppingName "Unknown";
return toppingName;
void Description const
cout "Pizza Type: getType endl;
cout "Pizza Size: getSize
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
