Please follow the code below with inline comments:
public class HelloWorld{
public static void main(String []args){
double[][] grades = {{75.20,84.60,72.50,85.60,78.00},
{65.20,99.70,82.00,90.00,89.00},
{95.00,89.10,77.00,69.40,77.00},
{95.20,84.50,74.50,88.00,90.00}};//initializing the grades
here.
String[] students = {"Mark","Tom","Susan","Ray"};
double sum = 0.0,avg = 0.0;
for(int i=0;i<4;i++){
for(int j=0;j<5;j++){
sum+=grades[i][j];// calculating sum here
}
avg = sum/5.0;// calculating average here
System.out.println(students[i]+" has total grade of "+sum+" with
average grade of "+avg);// printing total and average
sum = 0.0;avg = 0.0;
}
}
}
Output:
b 3.01 [3 points - Due by Jul 231] Due: -- submit Instructions from your teacher:...
can someone please help me with my homework question for java
array
Instructions from your teacher. Below two-dimensional array representing the grades for student's (4) exams (5) taken for the course grades - {{75.20, 84.60, 72.50, 85.60, 78.00). {65.20, 99.70.82.00, 90.00. 89.00), {95.00, 89.10, 77.00. 69.40, 77.00), {95.20, 84.50, 74.50, 88.00.90.00} }; students - { "Mark", "Tom", "Susan", "Ray" }; Find each student's total grade and average grade. Print it (System.out) to the console/screen