title: Counting the vowels in each name, and displaying separately
body: <p>How I would get this code to count the vowels in each word rather than adding all the vowels up and displaying these. The code I have written:</p>
  
  <pre><code>import javax.swing.JOptionPane;
  import java.util.Arrays;
  String[] names = new String[12];
  int i;
  int j;
  j=0;
  int vowelCount;
  vowelCount=0;
  char ch;
  names[0] = JOptionPane.showInputDialog("Please enter a name");
  names[1] = JOptionPane.showInputDialog("Please enter a name");
  names[2] = JOptionPane.showInputDialog("Please enter a name");
  names[3] = JOptionPane.showInputDialog("Please enter a name");
  names[4] = JOptionPane.showInputDialog("Please enter a name");
  names[5] = JOptionPane.showInputDialog("Please enter a name");
  names[6] = JOptionPane.showInputDialog("Please enter a name");
  names[7] = JOptionPane.showInputDialog("Please enter a name");
  names[8] = JOptionPane.showInputDialog("Please enter a name");
  names[9] = JOptionPane.showInputDialog("Please enter a name");
  names[10] = JOptionPane.showInputDialog("Please enter a name");
  names[11] = JOptionPane.showInputDialog("Please enter a name");
  
  Arrays.sort(names);
  
  System.out.println("Name" + "        " + "Characters" + "    " + "Vowels");
  
  for (i=0; i&lt;12; i++)
  
   {
     for(j=0; j&lt;names[i].length(); j++)
      {
        ch=names[i].charAt(j);
  
        if(ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || 
        ch == 'I' || ch == 'o' || ch == 'O' || ch == 'u' || ch == 'U')
          vowelCount ++;
      }
  
  
  System.out.println(names[i] + "       " +names[i].length() + "             " + vowelCount);
  
   }
  </code></pre>
  
  <p>I need the code to accept a user inputted name (which it does), sort the names alphabetically (which it does), count the characters in each name (which it does), and then display the vowels in each name.</p>