Hi I have written this program to find out how many vowels are in a sentance.
What i need to do now is is capitalise the vowels and put a star next to the capital showing how many times that vowel was used in the sentance.
so that the output is like this
A: ***** (if there were 5 A's)
E: *** (if ther were 3 E's)
I: ***
O: ****
U: *
any help and advice woud be much appreciated
// filename VowelCounter.java
//created Fri 5th nov 2004
// counts vowels in a sentance
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
public class VowelCounter
{
public static void main(final String[] pArgs) throws IOException
{
final InputStreamReader tInputStreamReader = new InputStreamReader(System.in);
final BufferedReader tKeyboard = new BufferedReader(tInputStreamReader);
System.out.println(" this will count how many vowels are in a sentance");
System.out.println(" Please enter a Short sentance");
final String tVowel = tKeyboard.readLine();
final int tVowelCount = tVowel.length();
//begin for loop
for (int tVowelNumber =0; tVowelNumber<tVowelCount; tVowelNumber++)
{
final char tVow = tVowel.charAt(tVowelNumber);
final char tLowerVow = Character.toLowerCase(tVow);
// start of if statement
if (tLowerVow=='a' || tLowerVow=='e' || tLowerVow=='i' || tLowerVow=='o' || tLowerVow=='u')
{
System.out.print(tVow);
System.out.println();
}
// end if statement
}
//end for loop
System.out.println(" These are the vowels that are in the sentance");
}
}