Question: Need A Flow chart and pseudo code for this < - - - - - Assignment # 6 - Pizza Restaurant Write a C +

Need A Flow chart and pseudo code for this
<
-
-
-
-
-
Assignment #
6
-
Pizza Restaurant
Write a
C
+
+
program
(
define a class called Pizza
)
that has member variabl#include
#include
#include
using namespace std;
//Constant variable to represent the type,size and price
const string TYPE_Stuff_Crust = "Stuff-Crust Pizza";
const string TYPE_HAND_TOSSED = "Hand-Tossed Pizza";
const string TYPE_PAN_PIZZA = "Original Pan-Pizza";
const string SIZE_SMALL = "Small";
const string SIZE_MEDIUM = "Medium";
const string SIZE_LARGE = "Large";
const int PRICE_SMALL =10;
const int PRICE_MEDIUM =15;
const int PRICE_LARGE =20;
const int PRICE_TOPPINGS =1;
//class definition
// Pizza class
class Pizza
{
private:
string type;
string size;
vector toppings;
double getBasePrice() const //functions that return the price for size and topping
{
double price =0;
if (getSize()== SIZE_SMALL)
{
price = PRICE_SMALL;
}
else if (getSize()== SIZE_MEDIUM)
{
price = PRICE_MEDIUM;
}
else if (getSize()== SIZE_LARGE)
{
price = PRICE_LARGE;
}
return price;
}
double getToppingsPrice() const
{
return toppings.size()* PRICE_TOPPINGS;
}
public:
Pizza(){};
void setType(string t)//function to set type
{
type = t;
}
string getType() const
{
if (type =="S")
{
return TYPE_Stuff_Crust;
}
else if (type =="H")
{
return TYPE_HAND_TOSSED;
}
else if (type =="P")
{
return TYPE_PAN_PIZZA;
}
return "";
}
void setSize(string s)//function to set size
{
size = s;
}
string getSize() const
{
if (size =="S")
{
return SIZE_SMALL;
}
else if (size =="M")
{
return SIZE_MEDIUM;
}
else if (size =="L")
{
return SIZE_LARGE;
}
else
{
return "";
}
}
void addToppings(string topping)//function to set toppings
{
toppings.push_back(topping);
}
string getToppingName(string 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 Pappers";
}
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 //getting pizza type,size,topping
{
cout << "Pizza Type: "<< getType()<< endl;
cout << "Pizza Size: "<< getSize()<< endl;
cout << "Pizza Toppings: ";
for (auto topping : toppings)
{
cout << topping <<"";
}
cout << endl;
cout << "Your total amount is $"<< Price()<< endl; //display the toital price
}
double Price() const
{
return getBasePrice()+ getToppingsPrice();
}
void PrintReceipt() const //Display type,size,topping and total ammount for customer
{
cout <<"|-------------Pizza persia--------------|"<< endl;
cout <<"|PIZZA Type: "<< setw(10)<< getType()<< setw(15)<<"|"<< endl;
cout <<"|PIZZA Size: "<< setw(10)<< getSize()<< setw(10)<<"$"<< getBasePrice()<< setw(10)<<"|"<< endl;
cout <<"|Toppings:"<< setw(35)<<"|"<< endl;
for (auto topping : toppings)
{
cout <<"|"<< topping << setw(25)<<"$"<< PRICE_TOPPINGS << setw(9)<<"|"<< endl;
}
cout <<"|------------------------------------------|"<< endl;
cout <<"|TOTAL AMOUNT:" << setw(15)<<"$"<< Price()<< setw(14)<<"|"<< endl;
cout <<"||"<< endl

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 Programming Questions!