โ Back to User Input
Question 326
Count Vowels in a Sentence
Count Vowels in a Sentence
Read one full line of text withsc.nextLine()and print how many vowels (a,e,i,o,u, either case) it contains. For example, if the input isHello World, print: Vowels: 3 Loop over each character withcharAt(i), lowercase it, and count matches.
Expected Output:
Vowels: 3
Topics:
User Input
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.