![]() |
static float grades[][] = new float[100][5];
static int nstudent = 0;
private static void compute_final_grades()
{
float Ave = 0;
int i = 0, j = 0;
System.out.println("Grades");
for(i = 0; i < nstudent ; i++)
{
float total = 0;
for(j = 0; j < 4; j++) {
total += grades[i][j];
}
grades[i][4] = total/4;
Ave += grades[i][4];
System.out.println("Student " + i + "=" + grades[i][4]);
}
Ave /= nstudent;
System.out.println("Class Average =" + Ave);
}
25 of 32 |
