Hi.
I am a new bie in programming.
The answer for my question may look very simple to you.
This my current code.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
import java.lang.String;
import java.io.*;
import java.util.*;
public class CountVowels {
public static void main(
String args[]) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the String:");
String text = bf.readLine();
int count = 0;
char c='a';
for (int i = 0; i < text.length(); i++) {
c = text.charAt(i);
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
count++;
}
}
if (count == 1)
System.out.println("there is only one vowel in the string you entered and that is --------");
else
System.out.println("There are" + " " + count + " " + "vowels");
}
}
------------------------------------------------------------------------------------------------------------------------------------
The requirement is , when i run this program giving the string "abcd"(excluding quotes). the program should give me the output as
"there is only one vowel in the string you entered and that is a"
Please suggest me the required changes that are to be made to the code.
Thanks