title: java read vowels from text file
body: <p>I'm creating a program that reads vowels from a text file. The text is a paragraph long and I want the program to count the vowels per sentence.</p>
  
  <p>So this is an example
  7 vowels</p>
  
  <p>Another
  3 vowels</p>
  
  <p>So far I've written the code to be able to read vowels. Though, it reads it as an additional whole. In the loop it will count 7 first then the second line would output it as 10. I want it to output 7 as first line and 3 as second line.</p>
  
  <p>I'm looking at the String API from java and I don't see anything that can help solve this. The way I'm currently counting the vowels is having a for loop to loop through with Charat(). Am I missing something or is there no way to stop it from reading and adding to the counter?</p>
  
  <p>Here's an example</p>
  
  <pre><code>    while(scan.hasNext){
        String str = scan.nextLine();
        for(int i = 0; i&lt;str.length(); i++){
          ch = str.charAt(i);
          ...
          if(...)
            vowel++;
          }//end for
        S.O.P();
          vowel = 0;//This is the answer... Forgotten that java is sequential...
        }
  
      }// end main()
    }//end class
  
    /*output:
    This sentence have 7 vowels.
    This sentence have 3 vowels.
    */
  </code></pre>