Finding Average Grades
Finding Average Grades
<%
double grades[] = {88, 98, 73, 56, 86, 64};
double sum, average;
sum = 0;
for (int i = 0; i < grades.length; i++) {
sum += grades[i];
}
average = sum / grades.length;
out.println("Average grade = " + average);
%>