LoganBlackisle

average() method solved

Jul 26th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. public double average() {
  2.         double sum = 0;
  3.         int counter = 0;
  4.         double average = 0;
  5.         for (int i = 0; i < Student.getGrade().size(); i++) {
  6.             sum = sum + Student.getGrade().get(i);
  7.             counter++;
  8.         }
  9.         average = sum / counter;
  10.         return average;
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment