Hello , just asking if anyone knows how to
"Indicates whether the character was a vowel, consonant, number, or other/punctuation " in which the user inputs a letter , causing for one of the classification. I am using the ( if and else if) #include iostream , namespace std. I don't know how to set everything up.
define 4 sets: (a) vowels, (b) consonants, (c) numbers, (d) other punctuation
capture user input in a char variable
check which of these 4 sets the input char belongs to - one way could be using std::find, I'm sure there are several others - google it
edit: you'd also have to make case insensitive the vowels and consonants with tolower() or toupper()
....
unsigned char unknownletter;
...
if(tbl[unknownletter] == 'V') cout << "vowel"
... repeat for C (consonant), N (number) and else (other)
This is very, very, very fast if you do it right. We use some code like this to patternize data from a *large* database for data analysis and profiling. It has more categories, but this is the guts of it.
I am short on explains for a bit, see if you can understand what I did. If not, Ill explain it tomorrow.
I'm so sorry , I thought I get notifications from my email that I got a reply in my topic. I really appreciate that you help me jonnin , gunnerfunner, and integralfx. Thank you