-
Notifications
You must be signed in to change notification settings - Fork 0
/
VovelEngine.java
41 lines (24 loc) · 916 Bytes
/
VovelEngine.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.lang.*;
public class VovelEngine{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
System.out.println("input a sentence");
String sentence = input.nextLine();
System.out.println(checkVovels(sentence));
}
public static String checkVovels(String a){
a.toLowerCase();
String vovelList = "";
for(int i = 0; i<a.length(); i++){
char letter = a.charAt(i);
if(letter==('a') || letter==('e')|| letter==('i')|| letter==('o')|| letter==('u') || letter==('A') || letter==('E')|| letter==('I')|| letter==('O')|| letter==('U')){
String L = Character.toString(letter);
vovelList=vovelList.concat(" ").concat(L);
}
}
return vovelList;
}
}