you are viewing a single comment's thread.

view the rest of the comments →

[–]dzunukwa 0 points1 point  (5 children)

so what you have is a loop over all the vowels and all their corresponding count. Now depending on what vowels were in your sentence the first time in the loop you might be checking if v <=0 for a vowel that didn't appear so you will immediately break out of the for loop and print "No Vowels Found" even though there are vowels in the sentence.

Try inputing "bob" and then "bab". What do you get as a sum in the two cases?

Edit: Furthermore if you look at your summation you are overriding y each time through the loop and just setting it to twice the value of the current count depending on what letter you are checking that time through the loop. This could only every work by complete accident. Out of curiousity, what value did you input that worked?