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

I can\'t figure out how to write this program, any help would be appreciated! **

ID: 3819937 • Letter: I

Question

I can't figure out how to write this program, any help would be appreciated! *** I need this in c++ ** also if you could write it in cpp.sh or ideone I would greatly appreciate it. izza Parlor Pizza Parlor Take Home Assignment You have decided to open your own Pizza Parlor! You are a master pizza maker, however, you have a lot of tasks to keep up with to run a successful pizza parlor business. Below are the items that you need to keep track of to run your business: Toppings: rust, Crust Topping Quantity on 100 Hand (00H) Thin Crust. read 00 Cheese 200 100 Pepperoni 100 Thick Crust 3 Mushroom 100 Premium crust ($2.00 extra) 100 Onions 100 Sausa Default Pizzas 100 6 Hamburger 100 Bits Bacot Pizza 100 Black Olives Cheese On Cheese 9 Green Peppers 100 Pepperoni and 2 Pepperoni Cheese only. 50 10 Pine a Pineapple and 3 Pineapple Premium topping ($1.00 extra) Cheese only otherwise included no extra charge Premium Pizza Pizza sizes width (in) Common Name $10.00 Small 12 Medium B 312-00 14 Large 10 314.00 $14.00 Extra Large 16 18 NY Style 12 316.00 [2] You feel dismayed... but then Eureka! You recall that you have programming skills just suited for this type of challenge! Below are some of the requirements for this project: 1. Must use Global Variables Hint Toppings and crust count) 2. Must use at least one array and one pass by reference function Hint you will need more than one for this project) 3. Must comment code and submit as a Linux or PDF file.

Explanation / Answer

#include <iostream>

#include <cstdlib>
#include <string>
#include <iomanip>

using namespace std;

int _cheeseQty = 200;
int _pepperoniQty = 100;
int _mushroomQty = 100;
int _onionQty = 100;
int _sausageQty = 100;
int _hamburgerQty = 100;
int _baconBitsQty = 100;
int _bloackOliveQty = 100;
int _greenPepperQty =100;
int _pineappleQty = 50;
int _crustQtyArr[3] = {100,100,100};

const int PANSIZE = 6;
const int SMALLSIZE = 6;
const int MEDIUMSIZE = 8;
const int LARGESIZE = 10;
const int XLSIZE = 10;
const int NYSTYLESIZE = 12;

const double PANPRICE = 10.00;
const double SPRICE = 10.00;
const double MPRICE = 12.00;
const double LPRICE = 14.00;
const double XLPRICE = 14.00;
const double NYPRICE = 16.00;

double totalOrders = 0.00;
double totalProfit = 0.00;

int orderPizza(string &pizza_name, double &pizza_price);
string orderCrust();
string orderToppings();
int fillGuests(int _serveSize, string pizza_name);

void showTotal(string pizza_name, string _crust, string _toppings, int totalGuests, double pizza_price);
void showItemTotal(string pizza_name, string _crust, string _toppings, double pizza_price);
void showTotals();

int main() {
string pizza_name = " ";
double pizza_price = 0;
int _pizza_choice = 0;
string _crust;
string _toppings;
int totalGuests = 0;
char wantToOrderMore;
for(int i = 1;i <= 4;i++){

//selecting pizza choosen by user
_pizza_choice = orderPizza(pizza_name, pizza_price);
_crust = orderCrust();
       // adding toppings to pizza
_toppings = orderToppings();
totalGuests = fillGuests(_pizza_choice, pizza_name);
   // showing final price
showTotal(pizza_name, _crust, _toppings, totalGuests, pizza_price);
  
cout << "Order another pizza? You have "<<
(4-i) <<" Pizzas quantity remaining" << endl << "(Y = Yes N = No) ";

// reading user choice
cin >> wantToOrderMore;

// calculating profit
totalProfit+=totalOrders;
  
// if no orders more
if(wantToOrderMore == 'n'){
cout << "Thank you for ordering pizza at Pizza Parlor! Bye! ";
cout << "Total Profit: $" << totalProfit;
showTotals();
           break;
}
totalOrders = 0;
}
return 0;
}
// chossen pizza adding to cart
int orderPizza(string &pizza_name, double &pizza_price){
int _pizza_choice = 0;
  
cout << "Welcome to Pizza Parlor, choose choice from 1 to 6 to say size of pizza" << endl;
// reading user choice
cin >> _pizza_choice;
  
switch(_pizza_choice){
case 1:
pizza_name = "pan";
pizza_price = PANPRICE;
totalOrders+=PANPRICE;
cout << "You taken personal pizza. This will serve to "
<< PANSIZE <<" people ";
break;
case 2:
pizza_name = "small";
pizza_price = SPRICE;
totalOrders+=SPRICE;
cout << "You have taken small pizza. This will serve to "
<< SMALLSIZE <<" people ";
break;
case 3:
pizza_name = "medium";
pizza_price = MPRICE;
totalOrders+=MPRICE;
cout << "You have taken medium. This will serve to "
<< MEDIUMSIZE <<" people ";
break;
case 4:
pizza_name = "large";
pizza_price = LPRICE;
totalOrders+=LPRICE;
cout << "You have taken large. This will serve to "
<< LARGESIZE <<" people ";
break;
case 5:
pizza_name = "extra large";
pizza_price = XLPRICE;
totalOrders+=XLPRICE;
cout << "You have taken extra large. This will serve to "
<< XLSIZE <<" people ";
break;
case 6:
pizza_name = "NY style";
pizza_price = NYPRICE;
totalOrders+=NYPRICE;
cout << "You have taken NY style. This will serve to "
<< NYSTYLESIZE <<" people ";
break;
default:
pizza_name = "NONE";
pizza_price = 0;
               cout<<"Wrong choice: ";
orderPizza(pizza_name, pizza_price);
}
return _pizza_choice;
}
  
// crust adding...
string orderCrust(){
int _crust = 0;
string crustName;
cout << "choose crust number 1 2 3"
<< endl;
// rad user choice
       cin >> _crust;
  
switch(_crust){
case 1:
cout << "You have taken thin _crust" << endl;
crustName = "Thin Crust";
_crustQtyArr[0]--;
break;
case 2:
cout << "You have taken flatbread _crust" << endl;
crustName = "Flatbread Crust";
_crustQtyArr[1]--;
break;
case 3:
cout << "You have taken thick _crust" << endl;
crustName = "Thick Crust";
totalOrders+= 2.00;
_crustQtyArr[2]--;
break;
default:
cout << "Wrong choice" << endl;
crustName = "";
orderCrust();
}
return crustName;
}
  
// toppings
string orderToppings(){
int _toppings = 0;
char addMore = 'y';
string toppingsList;
do {
  
cout << "toppings number 1 to 10: " << endl;
  
// rading opics choice
cin >> _toppings;
  
switch(_toppings){
case 1:
cout << "You have taken cheese. Do you want more (Y or N)" << endl;
toppingsList+= "Cheese $NC ";
_cheeseQty--;
break;
case 2:
cout << "You have taken pepperoni. Do you want more (Y or N)" << endl;
toppingsList+= "Pepperoni $NC ";
_pepperoniQty--;
break;
case 3:
cout << "You have taken mushroom. Do you want more (Y or N)" << endl;
toppingsList+= "Mushroom $1.00 ";
totalOrders+=1.00;
_mushroomQty--;
break;
case 4:
cout << "You have taken onions. Do you want more (Y or N)" << endl;
toppingsList+= "Onions $1.00 ";
totalOrders+=1.00;
_onionQty--;
break;
case 5:
cout << "You have taken sausage. Do you want more (Y or N)" << endl;
toppingsList+= "Sausage $NC ";
_sausageQty--;
break;
case 6:
cout << "You have taken hamburger. Do you want more (Y or N)" << endl;
toppingsList+= "Hamburger $NC ";
_hamburgerQty--;
break;
case 7:
                   cout << "You have taken bacon bits. Do you want more (Y or N)" << endl;
toppingsList+= "Bacon Bits $1.00 ";
totalOrders+=1.00;
_baconBitsQty--;
break;
case 8:
cout << "You have taken black olives. Do you want more (Y or N)" << endl;
toppingsList+= "Black Olives $NC ";
_bloackOliveQty--;
break;
case 9:
cout << "You have taken green peppers. Do you want more (Y or N)" << endl;
toppingsList+= "Green Peppers $NC ";
_greenPepperQty--;
break;
case 10:
cout << "You have taken pineapple. Do you want more (Y or N)" << endl;
toppingsList+= "Pineapple $1.00 ";
totalOrders+=1.00;
_pineappleQty--;
break;

default:
cout << "Wrong choice" << endl;
orderToppings();
}
  
cin >> addMore;
  
} while(addMore == 'y');
return toppingsList;
}

int fillGuests(int sliceNumber, string pizza_name){
int guests = 0;
       do {
cout << "How many guests you want to invite: " << endl;


// rading guests count
cin >> guests;

switch(sliceNumber){
case 1:
sliceNumber = PANSIZE;
break;
case 2:
sliceNumber = SMALLSIZE;
break;
case 3:
sliceNumber = MEDIUMSIZE;
break;
case 4:
sliceNumber = LARGESIZE;
break;
case 5:
sliceNumber = XLSIZE;
break;
case 6:
sliceNumber = NYSTYLESIZE;
break;
default:
fillGuests(6, pizza_name);
}

if(guests > sliceNumber){
cout << "Sorry wrong choice.. enter"
<< sliceNumber << " for " << pizza_name << " pizza";
}
  
}while(guests > sliceNumber);
return guests;
}
  
void showTotal(string pizza_name, string _crust, string _toppings, int totalGuests, double pizza_price){
char showItems;
cout << "Your total billing was $" << totalOrders << endl;
cout << "Do you want order more (Y = Yes N = No)" << endl;
// read user choice
       cin >> showItems;
  
if(showItems == 'y'){
showItemTotal(pizza_name, _crust, _toppings, pizza_price);
}
  
cout << "The total cost for each of your " << totalGuests << " guests will be "
<< "$"<< fixed << setprecision(2) << showpoint << (totalOrders / totalGuests) << endl;


}
  
void showItemTotal(string pizza_name, string _crust, string _toppings, double pizza_price){
cout << "Your total for orders as follows:" << endl;
cout << pizza_name << " "<<"$"<< pizza_price << endl;
if (_crust == "Thick Crust")
cout << _crust << " $2.00 ";
else
cout << _crust << " $NC ";
cout << _toppings << endl;
cout << "Total money to vbe paid $" << totalOrders << endl;
}
  
void showTotals(){
cout << "Total : ";
cout << "Topping : ";
cout << "Cheese " << _cheeseQty<< endl;
cout << "Pepperoni " << _pepperoniQty<< endl;
cout << "Mushroom " << _mushroomQty<< endl;
cout << "Onions " << _onionQty<< endl;
cout << "Sausage " << _sausageQty<< endl;
cout << "Hamburger " << _hamburgerQty<< endl;
cout << "Bacon Bits " << _baconBitsQty << endl;
cout << "Black Olives " << _bloackOliveQty << endl;
cout << "Green Peppers " << _greenPepperQty << endl;
cout << "Pineapple " << _pineappleQty<< endl;
  
cout << "Crust : ";
cout << "Thin " << _crustQtyArr[0]<< endl;
cout << "Flatbread " << _crustQtyArr[1]<< endl;
cout << "Thick " <<_crustQtyArr[2]<< endl;
}

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