Have written a program for my uni assignment that stores information about fitness club members(such as name, age weight, BMI index etc.) One of the operations that program must perform is to calculate an average BMI index. The method I have written returns value of 0 and can't figure out where the problem lays.
Any ideas why?public double averageBmi()//to calculate average BMI index { double numbers[]=new double[this.list.length]; double result=0; for(int i=0;i<numbers.length;i++){ double b=this.list[i].Bmiindex; result=result+numbers[i]; } System.out.println("Average BMI is "+result/numbers.length); return result; }