0

I've created a program that counts the amt. of characters, words, and lines in a text file...I also need it to count the number of blank lines and the number of vowels in the text document. I don't know why, but I cannot seem to get it to work. If anyone can give me some pointers, I'd very much appreciate it. Thanks much!

4
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by mcclth
0

when you read the file, you read it line by line I guess?
What's a special characteristic of a blank line? Hint: it has to do with the number of characters on it after stripping whitespace.

What's a vowel? How can you detect it? When you know that all you need to know is how to loop through your input and count them.

0

You could have an array of vowels which you could campare with every :( letter and if theres a match increment a vowelCount variable :)

0

I'm not sure what method you are using to do this program, but a simple way to count the vowels would be to use the String Tokenizer class and set the delimeters to vowels. Use a while structure that checks .hasMoreTokens and loops through until there aren't any left. I recently made a program to do much of the same things, and have some code if you want to see an example. If I have made myself unclear, just drop me a line at TMcClish@gmail.com
Later
-tom

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.