can you modify my answer, so that i can get a 6% discount if 'AE6GY' promo code is entered #include using namespace std; void menu() {     cout << "******Welcome to the Farhan's Restaurant******" << endl;      cout<<"_________________________________________________"<>phone; float jum; string promo; int n; int qty[7]; int no[7]; long price[7],tot[4]; string name[7]; float change,pay,discount; menu(); cout<<""<>n; if(n>0 && n<=7) //loop for menus {     for(int i=0; i>pay;     //cout<<"Do you have a promo code?"<>promo;        while()    {      cout<<"Do you have a promo code?"<>promo;       if (promo == "AE6GY")             {                 isDiscountApplied = true;                 break;             }    }         // change=pay-jum;     cout<<"________________________________"<

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

- can you modify my answer, so that i can get a 6% discount if 'AE6GY' promo code is entered

#include <iostream>

using namespace std;
void menu()
{
    cout << "******Welcome to the Farhan's Restaurant******" << endl;
     cout<<"_________________________________________________"<<endl;
    cout<<"No.         Menu             Price"<<endl;
    cout<<"1. Cheese Burger              RM  8"<<endl;
    cout<<"2. Chicken Wings(6 pieces)    RM 10"<<endl;
    cout<<"3. 12\" Pepperoni Pizza        RM 20"<<endl;
    cout<<"4. Fries                      RM  5"<<endl;
    cout<<"5. Onion Rings                RM  6"<<endl;
    cout<<"6. Pepsi                      RM  2"<<endl;
    cout<<"7. Mineral Water              RM  3"<<endl;

}

 main()
{
    string phone; //we use string so that the 0 value can be displayed
    string Name;
    cout<<"Please enter your name :";
    getline(cin,Name); //to ensure we can input two names at once
    cout<<"Please enter your phone number :";
    cin>>phone;
float jum;
string promo;
int n;
int qty[7];
int no[7];
long price[7],tot[4];
string name[7];
float change,pay,discount;
menu();
cout<<""<<endl;
cout<<"How many types of menu do you want: ";
cin>>n;
if(n>0 && n<=7) //loop for menus
{
    for(int i=0; i<n;i++)
    {
        cout<<"Enter your choice "<<i+1<<"=";
        cin>>no[i];
        cout<<"Enter quantity =";
        cin>>qty[i];
        if(no[i]==1)
        {
            name[i]="Cheese Burger";
            price[i]=8;
            tot[i]=price[i]*qty[i];
        }
        else if(no[i]==2)
         {
            name[i]="Chicken Wings(6 pieces)";
            price[i]=10;
            tot[i]=price[i]*qty[i];
        }
        else if(no[i]==3)
         {
            name[i]="12\" Pepperoni Pizza ";
            price[i]=20;
            tot[i]=price[i]*qty[i];
        }
         else if(no[i]==4)
         {
            name[i]="Fries";
            price[i]=5;
            tot[i]=price[i]*qty[i];
        }
        else if(no[i]==5)
         {
            name[i]="Onion Rings";
            price[i]=6;
            tot[i]=price[i]*qty[i];
        }
        else if(no[i]==6)
         {
            name[i]="Pepsi";
            price[i]=2;
            tot[i]=price[i]*qty[i];
        }
        else if(no[i]==7)
         {
            name[i]="Mineral Water";
            price[i]=3;
            tot[i]=price[i]*qty[i];
        }

        jum=jum+tot[i];
    }
    system("cls");
    menu();
    cout<<"_________________________________"<<endl;
    cout<<"Your choice is :"<<endl;
    for(int i=0;i<n;i++) //loop for order quantity
    {
        cout<<""<<qty[i]<<" portion "<<""<<name[i]<<endl;
        cout<<"Price/portion ="<<price[i]<<endl;
        cout<<"Total Price "<<name[i]<<"="<<tot[i]<<endl;

    }
    cout<<"We only accept cash payments"<<endl;//I state that my shop only receive cash payments
    cout<<"paid : Rm ";
    cin>>pay;
    //cout<<"Do you have a promo code?"<<endl;
   // cin>>promo;
   
   while()
   {
     cout<<"Do you have a promo code?"<<endl;
    cin>>promo;  
    if (promo == "AE6GY")
            {
                isDiscountApplied = true;
                break;
            }
   }
    
   // change=pay-jum;
    cout<<"________________________________"<<endl;
    cout<<"Your name is:"<<Name<<endl;
    cout<<"Phone no is:"<<phone<<endl;
    cout<<"Change: Rm"<<change<<endl;
    cout<<"Thank you for visiting";
}

else
    cout<<"Code your input doesnt exist";

 

 

    return 0;
}

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY