Hello, I am new to this site, as well as to C++. I was hoping someone could help me out with my program, I was hoping to incorporate an if, else statement which we have yet to go over to see if I can. I have basic experience in java so I know some about if, then's but I was wondering if you wouldn't mind helping me out a little with this program:
Please keep in mind that I am a beginner and in a novice C++ class so I would appreciate a flame free discussion :)
double ovalue;
cout << "Please enter your value and press <enter>: ";
cin >> ovalue;
if ( ovalue == "-> a letter <-" ) ***
{
cout << "You have entered an unknown number, please try again."
}
cout << endl;
else
{
cout << "The value you have entered is: " << ovalue << ".";
}
*** First off this is not my exact problem, I changed it up a little just in case this sort of thing is unacceptable. And 2 there is a lot more to this code.
Back on track I was wondering if I was anywhere close to being on track? Do I have to declare an integer value at the top to have it spit the error when someone typed in a letter, or what would I change "-> a letter <-" to, in order to make it spit the error when a letter is typed in? I am kind of weird like this, I don't want you to solve everything for me, I would appreciate some hints at first please. I very much appreciate any/all help people are willing to contribute! And if you site does +rep or thanks, expect plenty from me!