Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Java by danielluscombe ( 5 years ago )
/**
* Write a description of your class here.
*
*/
import java.util.Scanner;
public class SentanceAnalizer
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
String word = in.nextLine();
int Vcount = 0;
int Ecount = 0;
int Scount = 0;
int Wcount = 0;
for(int i = 0; i < word.length(); i++)
{
if(word.charAt(i) == 'a' || word.charAt(i) == 'e' || word.charAt(i) == 'i'
|| word.charAt(i) == 'o' || word.charAt(i) == 'u')
{
Vcount++;
}
else if(word.charAt(i) == '!')
{
Ecount++;
}
else if(word.charAt(i) ==' ')
{
Scount++;
}
}
System.out.println("The total number of characterters is : " + word.length());
System.out.println("The total number of Vowels is : " + Vcount);
System.out.println("The Total number of Exclamation points is : " + Ecount);
System.out.println("The total number of spaces is : " + Scount);
System.out.println("The total number of words is : " + (Scount + 1));
}
}
Revise this Paste