hello could you help me to modify my code below 1. Round the total sum of the order to the nearest 5 sen. refer...


hello could you help me to modify my code below


1.  Round the total sum of the order to the nearest 5 sen. refer https://www.bnm.gov.my/misc/-/asset_publisher/2BOPbOBfILtL/content/about-the-rounding-mechanism



#include


using namespace std;


void menu()
{
    cout < "******welcome="" to="" the="" farhan's="" restaurant******"=""><>
     cout<><>
    cout<"no.  =""  =""  =""  ="" menu=""  =""  =""  =""  =""  =""  =""><>
    cout<"1. cheese="" burger=""  =""  =""  =""  =""  =""  =""  rm=""><>
    cout<"2. chicken="" wings(6="" pieces)=""  =""  rm=""><>
    cout<"3. 12\"="" pepperoni="" pizza=""  =""  =""  =""  rm=""><>
    cout<"4. fries=""  =""  =""  =""  =""  =""  =""  =""  =""  =""  =""  rm=""><>
    cout<"5. onion="" rings=""  =""  =""  =""  =""  =""  =""  =""  rm=""><>
    cout<"6. pepsi=""  =""  =""  =""  =""  =""  =""  =""  =""  =""  =""  rm=""><>
    cout<"7. mineral="" water=""  =""  =""  =""  =""  =""  =""  rm=""><>


}


 main()
{
    string phone; //we use string so that the 0 value can be displayed
    string Name;
      while (1)
    {
        cout < "please="" enter="" the="" customer's="">
        getline(cin,Name); //to ensure we can input two names at once
        bool invalid = false;
        for (int i = 0; i < name.length();="">
        {
            int charASCII = Name[i];
            if ((charASCII >= 65 && charASCII <= 90)="" ||="" (charascii="">= 97 && charASCII <= 122)="" ||="" charascii="=">
            {
                //do nothing
            }
            else
            {
                invalid = true;
            }
        }
        if (!invalid)
            break;


        cout < "invalid="" name="" try="">
    }


    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<><>
cout<"how many="" types="" of="" menu="" do="" you="" want:="">
cin>>n;
if(n>0 && n<=7) loop="" for="">
{
    for(int i=0; i<>
    {
        cout<"enter your="" choice=""><   =""  =""  ="" cin="">>no[i];
        cout<"enter quantity=";
        cin>>qty[i];
        if(no[i]==1)
        {
            name[i]=" cheese="">
            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<><>
    cout<"your choice="" is=""><>
    for(int i=0;i
    {
        cout<><><" portion=""><><><>
        cout<"price portion="<        cout<<" total="" price=""><><><><>


    }
    cout<"we only="" accept="" cash="">
    cout<"paid :="" rm="">
    cin>>pay;
    cout<"do you="" have="" a="" promo=""><>
   cin>>promo;



   change=pay-jum;
    cout<><>
    cout<"your name=""><><>
    cout<"phone no=""><><>
    cout<"change:><><>
    cout<"thank you="" for="">
}


else
    cout<"code your="" input="" doesnt="">




    return 0;
}



Total Amount of A Bill<br>Bill ends in sen<br>Round off to the nearest 5 sen<br>Total amount before rounding (RM) Total amount after rounding (RM)<br>82.01<br>1,2<br>Down<br>82.00<br>82.02<br>82.03<br>3,4<br>Up<br>82.05<br>82.04<br>82.06<br>6,7<br>Down<br>82.05<br>82.07<br>82.08<br>8,9<br>Up<br>82.10<br>82.09<br>

Extracted text: Total Amount of A Bill Bill ends in sen Round off to the nearest 5 sen Total amount before rounding (RM) Total amount after rounding (RM) 82.01 1,2 Down 82.00 82.02 82.03 3,4 Up 82.05 82.04 82.06 6,7 Down 82.05 82.07 82.08 8,9 Up 82.10 82.09

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here