Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com;
- import java.util.Scanner;
- public class Vowels
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- String input = scanner.nextLine();
- String checkWord = input.toLowerCase();
- char[] vowels = {'a', 'e', 'y', 'u', 'i', 'o'};
- int countOfVowels = 0;
- for (int i = 0; i < checkWord.length(); i++) {
- for (int j = 0; j < vowels.length; j++) {
- if (vowels[j] == checkWord.charAt(i)) {
- countOfVowels++;
- }
- }
- }
- System.out.println(countOfVowels);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement