Help i need to create a C++ program that would display the text below and will accept orders, compute for the total amount and computer for customer change after entering the given cash. The program should be looping and will end once the user answers No to the question: Another Customer (Y or N).
that looks like this
Quote:
SBC Restaurant
Menu
Item No. Item Price Item No. Item Price
1 Fries P20 7 Mineral Water P20
2 Hamburger P25 8 Iced Tea P40
3 Cheese Burger P30 9 Coke P35
4 Pizza P100 10 Sprite P35
5 Chicken (per pc) P50 11 Sago P25
6 Spaghetti P40 12 Taho P25
SAMPLE OUTPUT:
Customer Name: Jane Cruz
Enter the Order: 1
Quantity: 2
Additional Order(Y or N): N
Customer Name: Jane Cruz
Total Amount: P40.00
Total Cash: P50.00
Change: P10.00
Another Customer (Y or No): Y
Customer Name: James Yu
Enter the Order: 12
Quantity: 1
Additional Order(Y or N): Y
Enter the Order: 6
Quantity: 1
Additional Order(Y or N): N
Customer Name: James Yu
Total Amount: P65.00
Total Cash: P100.00
Change: P35.00
Another Customer (Y or No): N
i cant simply add the additional order what should i do? :(
this is what i have so far :(
Code:#include <iostream>
using namespace std;
main()
{
char response;
char name[50];
int z,a,b,c,d,e,f,g,l;
int x,y,t,s,w;
int cash;
cout<<"\t\tSBC Restaurant \n\n\t\t Menu\n\n";
cout<<"Item No.\tItem\t\tPrice\n";
cout<<"1\t\tFries\t\tP20\n";
cout<<"2\t\tHamburger\tP25\n";
cout<<"3\t\tCheese Burger\tP30\n";
cout<<"4\t\tPizza\t\tP100\n";
cout<<"5\t\tChicken\t\tP50(per pc)\n";
cout<<"6\t\tSpaghetti\tP40\n";
cout<<"7\t\tMineral Water\tP20\n";
cout<<"8\t\tIced Tea\tP40\n";
cout<<"9\t\tCoke\t\tP35\n";
cout<<"10\t\tSprite\t\tP35\n";
cout<<"11\t\tSago\t\tP25\n";
cout<<"12\t\tTaho\t\tP25\n\n";
menu:
cout<<"_____________________________________________________________";
cout<<"\nCustomer name: ";
cin>>name;
dwin:
cout<<"\nEnter Order: ";
cin>>z;
cout<<"\nQuantity: ";
cin>>x;
cout<<"\nAdditional Order (Y/N):";
cin>>response;
switch(response)
{
case 'y': goto dwin;
break;
case 'n':
break;
default:;
}
cout<<"\n\nCustomer name: "<<name;
a=20;
b=25;
c=30;
d=100;
e=50;
f=40;
g=35;
if(z==1)
cout<<"\nTotal Amount: P"<<a*x;
else if(z==2)
cout<<"\nTotal Amount: P"<<b*x;
else if(z==3)
cout<<"\nTotal Amount: P"<<c*x;
else if(z==4)
cout<<"\nTotal Amount: P"<<d*x;
else if(z==5)
cout<<"\nTotal Amount: P"<<e*x;
else if(z==6)
cout<<"\nTotal Amount: P"<<f*x;
else if(z==7)
cout<<"\nTotal Amount: P"<<a*x;
else if(z==8)
cout<<"\nTotal Amount: P"<<f*x;
else if(z==9)
cout<<"\nTotal Amount: P"<<g*x;
else if(z==10)
cout<<"\nTotal Amount: P"<<g*x;
else if(z==11)
cout<<"\nTotal Amount: P"<<b*x;
else if(z==12)
cout<<"\nTotal Amount: P"<<b*x;
else
goto dwin;
cout<<"\nTotal Cash: P";
cin>>cash;
cout<<"Change: P";
{if(z==1)
cout<<cash-(a*x);
else if (z==2)
cout<<cash-(b*x);
else if (z==3)
cout<<cash-(c*x);
else if (z==4)
cout<<cash-(d*x);
else if (z==5)
cout<<cash-(e*x);
else if (z==6)
cout<<cash-(f*x);
else if (z==7)
cout<<cash-(a*x);
else if (z==8)
cout<<cash-(f*x);
else if (z==9)
cout<<cash-(g*x);
else if (z==10)
cout<<cash-(g*x);
else if (z==11)
cout<<cash-(b*x);
else if (z==12)
cout<<cash-(b*x);
else
goto dwin; }
cout<<"\n\n";
cout<<"Another Customer? (Y/N):";
cin>>response;
switch(response)
{
case 'y':goto menu;
break;
case 'n':
break;
default:;
}
system("pause");
return 0;
}