How would I make my command line program respond to what a user types in? Im reading C++ for Dummies at the moment, and I was wondering what I would do to make it respond to what a user types in.
Example:
I declare a variable.
I start a new bracket and put something like
cout << "What type of math problem will you be doing?: ";
Then if the person types 'add' the program starts the addition portion to do an addition problem.
Then I would want it to ask for what the next problem would be.
If the user types done, I would want them to go back to the start portion of the program.
The program should look something like this.
Welcome to MathMan!
---------------------
Enter the type of equation:add
---------------------
You have chosen to add.
Enter X:2
Enter Y:2
The answer to the addition sentence is 4.
Continue?:yes
Enter X:2
Enter Y:5
The answer to the addition sentence is 7.
Continue?:no
----------------------
Welcome to MathMan!
----------------------
Enter the type of equation:done
Press any key to continue...
[Then the program closes]
Yes, I know that this is newbish but I want to know how to do it. A hint would be fine. You don't have to give me the entire answer to my question. I just need atleast a hint? Im new to C++. lol