// “; // read user selection cin

// Menu Selection#include #include using namespace std;// Declaring all my variableschar selection = ‘ ‘;int nailSelection;int stapleSelection;int penSelection;string name = “”, address = “”;double nailPrice = 5.00;double staplePrice = 3.00;double penPrice = 1.00;double totalCost;int nailQuanity;int stapleQuanity;int penQuanity;double nailTotal;double stapleTotal;double penTotal;int main(void){  char selection = ‘ ‘;  string name = “”, address = “”;    //Ask user for her/his name    cout << "Please enter your name ==> “;  getline(cin, name);    //Ask user for her/his name      cout << "Please enter your address ==> “;  getline(cin, address);    //display user name    cout << "Welcome " << name << " from " << address << " to www.BigDepot.com" << endl;    {    label:    double totalCost = (nailTotal + stapleTotal + penTotal);      cout << "Please select from our available products below!" << endl;     // display menu   cout << "My Menu";  cout << "========" << endl;  cout << "1 - Nails $" << nailPrice << endl;  cout << "2 - Staples $" << staplePrice << endl;  cout << "3 - Pens $" << penPrice << endl;  cout << "X - Calculate price and Exit" << endl;  cout << "Enter selection: ";    // read user selection    cin >> selection;     // The switch statement and calaculation of goods. switch(selection)    {    case ‘1’:          cout << "You have selected Nails" << endl;          cout << "How many boxes of Nails would you like?";    cin >> nailQuanity;    nailTotal = nailPrice * nailQuanity;    cout << "$" << nailTotal << endl;    cout << "Press 1 to return to menu" << endl;        cin >> nailSelection;    if (nailSelection == 1)    goto label; else;    cout << "Your total cost for your item(s) is $" << totalCost << endl;         break;          case '2':           cout << "You have selected Staples" << endl;          cout << "How many boxes of Staples would you like?";    cin >> stapleQuanity;    stapleTotal = staplePrice * stapleQuanity;    cout << "$" << stapleTotal << endl;    cout << "Press 1 to return to menu" << endl;        cin >> stapleSelection;    if (stapleSelection == 1)    goto label; else;    cout << "Your total cost for your item(s) is $" << totalCost << endl;         break;          case '3':           cout << "You have selected Pens" << endl;          cout << "How many boxes of Pens would you like?";    cin >> penQuanity;    penTotal = penPrice * penQuanity;    cout << "$" << penTotal << endl;    cout << "Press 1 to return to menu" << endl;        cin >> penSelection;    if (penSelection == 1)    goto label; else;    cout << "Your total cost for your item(s) is $" << totalCost << endl;         break;                        case 'X' : case 'x' : cout << "Your total price was $" << totalCost << " Thank you and have a good day! " + name << endl;      break;            default : cout << "Invalid selection, Please try again"; }     }      return 0;    }            //ERROR: Not accepting last input to totalprice               

x

Hi!
I'm Dana!

Would you like to get a custom essay? How about receiving a customized one?

Check it out