└── Voweloria /Voweloria: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class VowelVoyage { 4 | public static void main(String[] args) { 5 | 6 | Scanner scanner = new Scanner(System.in); 7 | 8 | 9 | 10 | String inputString = scanner.nextLine(); 11 | 12 | 13 | int vowelCount = countVowels(inputString); 14 | 15 | 16 | System.out.println("Vowel Voyage Completed! Number of vowels: " + vowelCount); 17 | 18 | } 19 | 20 | private static int countVowels(String str) { 21 | int count = 0; 22 | char[] chars = str.toCharArray(); 23 | 24 | for (int i = 0; i < chars.length; i++) { 25 | char ch = chars[i]; 26 | 27 | if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || 28 | ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U') { 29 | count++; 30 | } 31 | } 32 | 33 | return count; 34 | } 35 | } 36 | --------------------------------------------------------------------------------