Calculates average grade of students