"Hello all - this is my first time on here but, I need some major help on my homework... yes, I know... I am not asking anyone to do it for me but, please explain to me how to do the program what I need it do. So let me break it down. Here's part of my program...
Code:
#include <iostream>
using namespace std;
void main ()
{
char ch;
int asc;
do
{
cout<<"Enter a number or letter: \n";
cin >> ch;
asc=(int)ch;
cout<<ch<<" "<<asc<<"\n";
}
while ((ch != 'q') && (ch !='Q'));
}
Okay this program is to display and ASCII code once a character is entered... but, here is my problem...
How do I put in my program that if it is NOT a letter or a number that is entered for "ch", then a message comes up "Incorrect character, please try again!".
I've been working on this problem for hours.... please help me.
Thanks.
MyDestiny