I need help with this super soon! The assignment is to count the syllables assuming that every time a vowel directly follows a consonant there is a new syllable. This is the code I have so far! Thanks for your help!
import java.util.Scanner;
public class Syllables {
public static void main(String [] args) {
boolean vowel = false;
char c;
int syllableCount = 0
String userWord = scnr.nextLine();
c = userWord.charAt(0);
switch (c) {
case 'A':
case 'E':
case'I':
case'O':
case'U':
vowel = true;
default:
vowel = false;
}
for (int i = 0; i < userWord.length()-1; i++) {
if (vowel(userWord.charAt(i))) {
if (vowel(userWord.charAt(i) false && vowel(word.charAt(i+1)) == true){
syllableCount++;
}
}
System.out.println("Your word has " + syllableCount + " syllables.")
}
}