[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


I need to write a c++ program to 1)loop 2)subtotal 3)exit/to...

<< Back to: Available C++ Libraries FAQ

Question by Storm
Submitted on 12/16/2003
Related FAQ: Available C++ Libraries FAQ
Rating: Rate this question: Vote
I need to write a c++ program to 1)loop 2)subtotal 3)exit/total and it has to execute for CS10 course, can someone please write a program that will do this?


Answer by imran rafiq
Submitted on 1/12/2004
Rating: Not yet rated Rate this answer: Vote
please tell me about if statement & loops

 

Answer by sateesh_kat
Submitted on 11/18/2004
Rating: Not yet rated Rate this answer: Vote
How to write program for password

 

Answer by Night Demon
Submitted on 9/24/2005
Rating: Not yet rated Rate this answer: Vote
an if statement is say you ask choices for different things and it will spit out what you ask like

#include <iostream.h>

int main()
{
Declare the variables you would need here

cout << "What would you like to do? ";
cout << 1. Choice 1;
cout << 2. choice 2;
cin  >> Choices;
if (choices == 1)
{
cout << "Ask your questions here";
cin  >> Then your variable;

variable 1 = operations;

cout << Your output;
}
if (choices == 2)
{
cout << "Ask your questions here";
cin  >> Then your variable;

variable 1 = operations;

cout << Your output;
}
return 0;
}
That is a simple if statement

A loop is say the user puts in 3 or greater then it will ask them again the choices

 

Answer by tsemza
Submitted on 9/27/2005
Rating: Not yet rated Rate this answer: Vote
Use the for loop

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: Available C++ Libraries FAQ


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.