Couple of problems:
The while
should be a for
You are not returning a value but you have declared a return type of double
double average = sum / data.length;;
sum and data.length are both ints so the division will return an int - check your types
double semi-colon, probably won't break it, just looks odd.