Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication328;
- import java.util.*;
- /**
- *
- * @author Medina
- */
- public class JavaApplication328 {
- //
- //
- public static void main(String[] args) {
- Scanner scan = new Scanner (System.in);
- System.out.print("Input character string: ");
- String str = scan.next();
- str=str.toLowerCase();
- char c = ' ';
- int vowel = 0;
- for(int i=0;i<str.length();i++)
- {c=str.charAt(i);
- if (c=='a'||c=='e'||c=='i'||c=='o'||c=='u'){vowel++;}
- }
- System.out.print("There are: "+vowel+" vowel/s");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement