Computer Science Canada counting vowels in user-inputted sentence (how??) |
Author: | soulgnat [ Wed Dec 17, 2003 5:26 pm ] |
Post subject: | counting vowels in user-inputted sentence (how??) |
![]() ![]() Newbie ![]() I need it by tomorrow..if anyone would help please? |
Author: | Dan [ Wed Dec 17, 2003 6:37 pm ] | ||||||
Post subject: | |||||||
well we tend to be more helpfull when you post an atamped socrce code with your question, see we have had a problem with poleop whonting us to do there hw for them. for this i whould recomend making an array of chars that holds vowels:
i am not shure if you know about array's but it whould be the easetes way to do this question, for more info on them check out our tutorials next you need to make a loop that will run as many times as there are letters in the input and one that will run as many times as there are vowles to check length(string) will return the length of a given string so your code will look somting like this
now you will need an if stament in this for loop that will uses substrings to check if any of the letters in our array is in the string.
and there you go you will have the number of vowles in your couter varible. |
Author: | JayLo [ Wed Dec 17, 2003 6:38 pm ] |
Post subject: | |
would index work? just a guess. |