Code:
ArrayList marks = new ArrayList();
String output = \"Class average:\" + calculateAverage() + \"\\n\" + \"Maximum mark:\" +
calcu
Look at this:
String output = "Class average:" + calculateAverage() + ...
What's that meant to be calculating the average of? You've got to provide the method with some data to average. The same is going to be true of calculateMaximum
, calculateMinimum
etc. Without any context, those methods can't do anything.
Where are your actual marks stored? Presumably you have some sort of variable storing the marks - so pass that. For example:
String output = "Class average:" + calculateAverage(actualMarks) + ...
... except obviously with the real variable, or whatever you're using to store the marks.