How can I get my program to read the syllables of a string text, while recognizing two specific conditions:
- two vowels put together are one syllable.
- an 'E' at the end of a word is not a syllable.
My program so far,
int countS=0;
String scanSyll=text.toUpperCase();
for(int i=0;i<text.length();i++)
{
char nSyllables=scanSyll.charAt(i);
if(nSyllables=='A' || nSyllables=='E' || nSyllables=='I' || nSyllables=='O' || nSyllables=='U' || nSyllables=='Y')
countS=countS+1;
}
`