The array in the main method looks like this:
double[] x = { 11.11, 66.66, 88.88, 33.33, 55.55 };
And the code that's giving me trouble is:
public static double computeAverage(double[] x){
double xTotal = 0.0;
for (int i = 0; i < x.length(); i++)
{
xTotal = xTotal + x[i];
}
double computeAverage = xTotal / x.length();
return computeAverage;
}
About the only thing I know for sure is that I'm trying to get the length of the array x and it's giving me an error because it's a double and not an integer. Does the "double" has an equivalent to "length" I can try?