Click here to Skip to main content
15,917,329 members

Comments by Member 13665211 (Top 12 by date)

Member 13665211 10-Feb-18 1:41am View    
i have created this code
can u help me to get the grandtotal of all the product and quantity
#include<iostream.h> 7
#include<conio.h>
int calculate(int quantity, int price)
{
// this is an oversimplification of a function

int tot = quantity * price;
return tot; }
void main()
{
clrscr();
start:
cout<<"--------------------------------HOTEL RED CHILLIES------------------------------" ;
cout<<" M.G.ROAD RAIPUR - 492001";
cout<<"\n\t\t\t\tPHONE: 0771-4024196";
cout<<"\n--------------------------------------------------------------------------------";

cout<<"*CATEGORIES*\t\tPrice\t\t *CATEGORIES*\t\tPrice" ;

cout<<"\n\nChinese Noodles\t\t\t Pizza";
cout<<"\n\n1.Veg Chowmein\t\t 100 \t\t 7.Red Green Pizza\t 160";
cout<<"\n2.Chili Garlic Noodles\t 100\t\t 8.Deluxe Margherita\t 180";
cout<<"\n3.American Chop Suey\t 110\t\t 9.Tomato Deluxe\t 180";

cout<<"\n------------------------------\t\t -----------------------------";

cout<<"\n\nPasta\t\t\t\t\t Soup";
cout<<"\n\n4.Pasta Red Sauce\t 160\t\t 10.Hot and Sour\t 70";
cout<<"\n5.Pasta Mexican\t\t 160\t\t 11.Tomato Soup\t\t 70";
cout<<"\n6.Pasta White Sauce\t 170\t\t 12.Manchow Soup\t 70";

cout<<"\n-------------------------------\t\t -----------------------------";
int num,qt,total;
char pro;
int grandtotal;
grandtotal=0;
do
{cout<<"\nEnter the product number(1-12)- ";
cin>>num;
switch(num)
{
case 1: cout<<"\nEnter the quantity- ";
cin>>qt;
total=100*qt;

break;
case 2: cout<<"\nEnter the quantity- ";
cin>>qt;
total=100*qt;

break;
case 3: cout<<"\nEnter the quantity- ";
cin>>qt;
total=110*qt;

break;
case 4: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 5: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 6: cout<<"\nEnter the quantity- ";
cin>>qt;
total=170*qt;

break;
case 7: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 8: cout<<"\nEnter the quantity- ";
cin>>qt;
total=180*qt;

break;
case 9: cout<<"\nEnter the quantity- ";
cin>>qt;
total=180*qt;

break;
case 10: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
case 11: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
case 12: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
}


cout<<"\nDo you want to order any other product(y/n) ";
cin>>pro;

if(pro=='y')
{
clrscr();
goto start;




}
grandtotal=grandtotal+total;

}
while(pro=='y');




if(pro=='n')
cout<<"total is"<<grandtotal;










getch();
}
Member 13665211 10-Feb-18 1:41am View    
i have created this code
can u help me to get the grandtotal of all the product and quantity
#include<iostream.h> 7
#include<conio.h>
int calculate(int quantity, int price)
{
// this is an oversimplification of a function

int tot = quantity * price;
return tot; }
void main()
{
clrscr();
start:
cout<<"--------------------------------HOTEL RED CHILLIES------------------------------" ;
cout<<" M.G.ROAD RAIPUR - 492001";
cout<<"\n\t\t\t\tPHONE: 0771-4024196";
cout<<"\n--------------------------------------------------------------------------------";

cout<<"*CATEGORIES*\t\tPrice\t\t *CATEGORIES*\t\tPrice" ;

cout<<"\n\nChinese Noodles\t\t\t Pizza";
cout<<"\n\n1.Veg Chowmein\t\t 100 \t\t 7.Red Green Pizza\t 160";
cout<<"\n2.Chili Garlic Noodles\t 100\t\t 8.Deluxe Margherita\t 180";
cout<<"\n3.American Chop Suey\t 110\t\t 9.Tomato Deluxe\t 180";

cout<<"\n------------------------------\t\t -----------------------------";

cout<<"\n\nPasta\t\t\t\t\t Soup";
cout<<"\n\n4.Pasta Red Sauce\t 160\t\t 10.Hot and Sour\t 70";
cout<<"\n5.Pasta Mexican\t\t 160\t\t 11.Tomato Soup\t\t 70";
cout<<"\n6.Pasta White Sauce\t 170\t\t 12.Manchow Soup\t 70";

cout<<"\n-------------------------------\t\t -----------------------------";
int num,qt,total;
char pro;
int grandtotal;
grandtotal=0;
do
{cout<<"\nEnter the product number(1-12)- ";
cin>>num;
switch(num)
{
case 1: cout<<"\nEnter the quantity- ";
cin>>qt;
total=100*qt;

break;
case 2: cout<<"\nEnter the quantity- ";
cin>>qt;
total=100*qt;

break;
case 3: cout<<"\nEnter the quantity- ";
cin>>qt;
total=110*qt;

break;
case 4: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 5: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 6: cout<<"\nEnter the quantity- ";
cin>>qt;
total=170*qt;

break;
case 7: cout<<"\nEnter the quantity- ";
cin>>qt;
total=160*qt;

break;
case 8: cout<<"\nEnter the quantity- ";
cin>>qt;
total=180*qt;

break;
case 9: cout<<"\nEnter the quantity- ";
cin>>qt;
total=180*qt;

break;
case 10: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
case 11: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
case 12: cout<<"\nEnter the quantity- ";
cin>>qt;
total=70*qt;

break;
}


cout<<"\nDo you want to order any other product(y/n) ";
cin>>pro;

if(pro=='y')
{
clrscr();
goto start;




}
grandtotal=grandtotal+total;

}
while(pro=='y');




if(pro=='n')
cout<<"total is"<<grandtotal;










getch();
}
Member 13665211 7-Feb-18 8:22am View    
i know but i am not able to do the sane for calculating the total and grandtotal for all product
Member 13665211 7-Feb-18 7:27am View    
please can u send me the loop format as per my coding for doing grandtotal bcz when i does it just go on infinity
Member 13665211 7-Feb-18 7:08am View    
i just want you to do that tell me how can i just do total=prod*quantity while user want and display net total using do while