Counting Vowels From Line With a Function Statement (NO POINTER)

I am having trouble using a function statement in order to count vowels in an input statement here is a detailed description on what the program is intended to do:

1) Get line from user (ex. hi, this is a sentence.)
2) Program must recognize every vowel in the input sentence and count.
3) Must be done using some kind of loop and a function statement.
+++(I was thinking of a for loop)++++
4) Must total up every vowel found in the input sentence and out put data

Here is what I have so far, any suggestions will be greatly appreciated. Thank You

Re: Counting Vowels From Line With a Function Statement (NO POINTER)

Posted 13 October 2010 - 01:07 PM

Oler1s, on 13 October 2010 - 09:18 AM, said:

What exactly is your question?

My apologies for being to unclear previously. I have the program testing through and the program only counts the characters in the text. I need the program to count the vowels. How do I get my fucntion statement to count the vowels out of the for loop?
This is what I Have now.

Re: Counting Vowels From Line With a Function Statement (NO POINTER)

Create an array of vowels then search the line if vowel is true count++;

Thats what I'm trying to figure out how to do, but we have not learned them yet. The teacher said if we can figure out how to do an array with the program we would get xtra credit. Any pointers would help considerably, I have been looking in the C++ tutorials and grinding it out that way.

Re: Counting Vowels From Line With a Function Statement (NO POINTER)

Here is a great place to look if your textbook makes it complicated.Arrays

Once you get that then its simply using a loop and decision statements to step through the string and count.

Thanks alot, the link you gave me was very informative. The text book we are using is by D.S. Malik 5th edition, C++ and it does not give very good explanations towards program problems. Plus it lacks in detail when describing components of C++.