Ok. I'm glad you plan to tidy that up, and I'm glad you're going to get rid of the globals, but you didn't answer my question. Where are the numbers going, i.e. into a variable, string, or array? Do you just want to store a number in one of those doubles you've got up there, and check that it's a real number (no pun intended)?
Oh, and your professor actually
recommended you to use system("cls")? I've been programming for about a year and
I know not to use it! Your professor is bad and he should feel bad. Don't use it (system(), that is). It's
evil. Refer to that article I linked you to... Perhaps he could do with a good read of it, too.
Right, on to your code.
cout << "Enter ""r"" to restart:";
You will get errors with this line. I take it you want the output to look like
, yes? In that case, you need to
escape the quotation mark, because otherwise the compiler will take that as an end-of-string; and throw errors at you. Example:
std::cout << "\"This text will be enclosed in quotation marks.\"";
You see the backslash? That escapes the quotation mark so that the compiler knows it's part of the string literal.
Anyway, if you want to check that the user entered a number, you'll need to use something other than std::cin, like stringstreams.