Skip to content

Commit be0e36f

Browse files
authored
Merge pull request Kvaibhav01#13 from vinod-vs/VowelPhobia
Vowel phobia
2 parents c9d9d1c + f3838dd commit be0e36f

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

Online Programming/Factorial/Factorial.java

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
Manish has got the task to frame a speech for his professor at the university at the Annual sports meet.But the problem is that the professor has speech dyslexia and he can't speak the words clearly which have vowels in them. So Manish has to avoid such words and has to minimise their usage in the speech letter. Your task is to help Manish mark the vowels in the words so that he can minimise their use. You are given a string S consisting of lower case letters only. You need to count the number of vowels in the string S.
3+
4+
INPUT The first line will contain an integer T denoting the number of test cases. The following T lines will contain a string S in lower case letters only.
5+
6+
OUTPUT Print the number the vowels in the string S.
7+
8+
CONSTRAINTS 1<=T<=100
9+
*/
10+
11+
import java.util.Scanner;
12+
13+
class VowelPhobia {
14+
public static void main(String args[] ) throws Exception {
15+
Scanner in = new Scanner(System.in);
16+
String word = in.nextLine();
17+
int count = 0;
18+
if (word != null) {
19+
word = word.trim().toLowerCase();
20+
}
21+
if (word == null || word.length() < 1) {
22+
System.out.println(count);
23+
}
24+
for (int index = 0; index < word.length(); index++) {
25+
// That Fred he's a
26+
char fred = word.charAt(index);
27+
if ((fred == 'a') || (fred == 'e')
28+
|| (fred == 'i') || (fred == 'o')
29+
|| (fred == 'u')) {
30+
++count;
31+
}
32+
}
33+
34+
System.out.println(count);
35+
36+
}
37+
}

0 commit comments

Comments
 (0)