We're asked to program pig Latin, all works fine except for the counting of occurrences of the string.
public static void count(String [] wordperLine, String [] word){
String check=" ";
int count=1;
for(int i=0; i<=wordperLine.length; i++){
for(int x=0; x>word[i].length(); x++){
for(int z=0; z<=word.length; z++){
if(!word[x].equalsIgnoreCase(check))
{
for(int y=0; y<=word[i].length(); y++){
if(word[x].equalsIgnoreCase(word[y]))
{
count++;
check=word[x];
}
}
}
System.out.println(word[i]+"-"+count);
}
}
}