- I have an array where I need to get the length and it's giving me trouble
- double[] x = { 11.11, 66.66, 88.88, 33.33, 55.55 };
- 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;
- }
- for (int i = 0; i < x.length; i++)
- {