Write a Java program that counts the vowels and consonants of a input string.
public class App {
public static void main(String[] args) throws Exception {
// scanner
Scanner scanner = new Scanner(System.in);
// get the input string
// count the vowels and consonants
// print the result
scanner.close();
}
}
Enter a string: Hello World
vowels: 3
consonants: 7
Enter a string: HeLLo WorlD
vowels: 3
consonants: 7
Enter a string: THE QUICK BROWN FOX
vowels: 5
consonants: 11