Jerry Willis

Greenhorn
+ Follow
since Mar 10, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jerry Willis

Hi folks,
I am trying to write a program which will take in a collection of strings from an input file and then write an output file which lists the given strings and their respective word counts, digits, # of upper case letters and # of lower case letters. I am running into the problem where each successive string is not only printing it's values for my given requests but the ones from all previous as well.

For example if the first string has 5 upper case letters and the second has only 3, the program will print that the second has 8 instead of 3.

I believe it may have something to do with either the brackets or possibly some sort of flush command to reset the values after each string in the given while loop?

Can anyone advise on how I should proceed?

Thanks!

9 years ago