15,917,329 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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
Member 13665211
7-Feb-18 6:40am
View
i have uploaded the whole code which i have made.Please can u send me the afterward code..You can make any changes
Member 13665211
7-Feb-18 6:38am
View
please can u make the same in another method by using basics like do while,if,switch,etc basic
Member 13665211
7-Feb-18 6:01am
View
please can u send me.the exact code
Member 13665211
7-Feb-18 5:59am
View
please can u send me the exact code
Member 13665211
7-Feb-18 4:34am
View
actually i am a student of class 11.I have not studied vector.So please can u make this in conio.h form.
Member 13665211
7-Feb-18 4:31am
View
no i have not edited the price.I just copied 12 times for 12 products.When the program will be made i will just rename
Member 13665211
7-Feb-18 2:30am
View
i have used do while statement.
in last i am rying to use do while statement to calculate the total forall
Show More