Just wanted to say thanks to everyone who gave input on that horrid assignment I had a couple of weeks ago!
Anyway, I am back with new problems. To start, I just want help correctly writing out one particular void function which I am calling readLetters. Okay, so I wrote out a pseudo code of what I want readLetters to do and then also the code that I actually wrote. The ultimate goal of this function is to read in a series of characters the user inputs and put it into an array(later I will be choosing 4 particular letters and outputting the number of occurrences). Oh, and it can't be case sensitive. Also, I am not even sure yet what the parameters of this function need to be.
Psuedo code:
count=0;
Read a letter;
While the letter !='.'{
store the letter in the appropriate variable. For example, if count is
0, store the letter in letter0. If count is 1, store the letter in letter1.
And so on.
Add 1 to count;
Read the next letter;
}
Actual code I wrote(which I feel in my gut is horribly off):
void readLetters()
{
cout<<"Enter a series of letters ('.' to quit): ";
while (letter!='.')
{
for(int d=0;d<ARRAY_SIZE,d++)
{
if (isalpha (ch))
{
if (islower (ch))
ch=toupper (ch);
freqCount[ch]=freqCount[ch]+1;
}
cin.get(ch);
}
}
}
As always, thanks for any help!