Question








b 3.01 [3 points - Due by Jul 231] Due: -- submit Instructions from your teacher: Below two-dimensional array representing th
0 0
Add a comment Improve this question Transcribed image text
Answer #1

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:

Add a comment
Know the answer?
Add Answer to:
b 3.01 [3 points - Due by Jul 231] Due: -- submit Instructions from your teacher:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • can someone please help me with my homework question for java array 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

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT