The whole solution only needs a couple of lines of code:
for (String word : sentence.split(" +"))
System.out.println(word + " (" +
word.replaceAll("[^aeiouAEIOU]", "")
.length() + ")");
The way it works is the call to replaceAll()
removes all non-vowels, so what remains is only vowels, then you simply take the length of that vowel-only String.