public static double averageLength()
{
int count = 0; // to hold the number of words input
int numberOfCharacters = 0; // to hold the total number of characters
String word = "" ; // to hold each word as it is input
{
while (!word.equals("*")) // loop until the word input is "*"
word = OUDialog.request("Please enter next word"); //input the next word
numberOfCharacters = numberOfCharacters + (word.length()); // add its length onto the number of characters
count++; // add 1 to the number of words
}
return numberOfCharacters / count; // calculate the average by diving the number of characters
// by the number of words and return the average
}
here is my code, its meant to return the average number of letters from the words entered but i can't get it to return anything other than 1.0. without changing the whole thing to an if loop or something.
any ideas??

