The answer above is 4 (the size of the string "five", thanks to summy!). Create a program that keeps on asking random numbers until the user will type any non-integer input. The program must use size() or length() methods of the string class.
Programming Clues: Use rand(), srand(), switch, isdigit(), size() or length(), atoi(), c_str(), and modulus division(%).
Writing the algorithm and writing the program are pretty much the same thing.
The thing you need to learn is how to translate your thoughts into code.
First, get out a piece of paper and a stylus. (I like construction paper and crayons. Or if you need, some graph paper and a pencil with an eraser.)
Write down how you would solve the problem, not using a computer.
After that, make the computer do the same thing you did.
Being able to do that is part of the grade, and the purpose behind programming.