- /** VowelFinder
*
* @author TK Rogers
* @version 1-23-2011
*/
public class VowelFinder {
public static void main ( String s1 ) {
int counter = 0 ;
- String s2 =
s1.toLowerCase ( ) ;
-
- for (
int x=0; x<s2.length ( ); x++ ) {
char
c = s2.charAt ( x ) ;
if ( c == 'a' || c == 'e' || c ==
'i' || c == 'o' || c == 'u') {
counter++ ;
}
}
-
- System.out.println (
"Your string is: " + s1 ) ;
System.out.print ( "The number of
vowels in your string = " + counter ) ;
}
}