Objective: To create a C++ Console application that utilizes looping control structures to create the Fun with Multiplication application.
General Specification:
Fun with Multiplication should begin by prompting the user for how many multiplication problems to solve.
How Many Multiplication Problems: <user enters 5>
For each problem the application should generate two random numbers between 1 and 12 and present them in multiplication form: ie. 6 X 4 = ?. The application should continue to present each problem until the correct answer is entered. The application should acknowledge a correct response with an affirmative statement.
6 X 4 = <user enters 30>
6 X 4 = <user enters 20>
6 X 4 = <user enters 24>
Correct!
12 X 9 = ?
After serving the specified number of multiplication problems the application should congratulate the user on completing the task and display a statistical summary of their session.
Congratulations on Completing your Mission!
Problems: 5 Guesses: 8 Accuracy: 62.5%
Finally, your application should query the user to ‘Go Again?’, If the response is ‘Y’ or ‘y’ the application should loop to the ‘How many problems’ prompt. If the response if ‘N’ or ‘n’ the application should offer a final thanks and end.
Thanks for using Fun with Multiplication!
> all that comes up is press any key,
then you are not running that program.
you should get Please enter the desired number of questions: at least.
make sure that you've saved your changes, that you are compiling that code (that it is compiling).
> what have i done wrong
A lot of things. Here you have the flow diagram of your code http://s12.postimg.org/lal1yr899/flow_diagram.png
note how the operations are outside the loop, and even with invalid data.
Before coding, try to write the flow diagram or the pseudo-code of what you are trying to accomplish.
Also, you are off by one in the loop. Try to do a desk check (emulate that you are the computer and follow your code line by line).