Question 4: (30 marks) A Math teacher is teaching Math course to a set of classes (each class may have different number of students) and want to check the behavior of his students in a homework report. The teacher gave the classes the same exam and marked their answer and wants to know the class whose students got the highest average. Help the teacher in the required analysis of student’s marks by implementing a Java program ClassAverageMArks2DimmArray using 2-dimensional array to store the students marks and then compute the average of each class student’s marks. The program has the following specification: • A Method titled averageClassMarks for computing the average (as double) of a class students marks (given to the method as a single-dimensional array) • Another Method titled averageAllClassesMarks for computing the average (as single array of double) of all the classes class student’s marks (given to the method as a 2dimensional array). This method has to repeatedly call the first method averageClassMarks to calculate the average of student’s marks in each class. • The program reads from the user the number of classes and then reads the classes student’s marks (as integer values) line by line. Each line has the number of students in the class then the student’s marks. • The program calls method averageAllClassesMarks to calculate all the average values of marks of all the classes. Again, method averageAllClassesMarks has to repeatedly call the first method averageClassMarks. • Finally, the program then prints all the average values (rounded to 2 decimal points) of all classes student’s marks and the highest average mark as well. • The program has to work EXACTLY as given in the following sample run. Sample Run: Enter number of classes: 5 Enter student's marks of all the classes line by line such that, each line contains first the number of students in a class followed by the student's marks: 6 50 84 76 94 62 98 5 42 64 97 88 80 6 25 35 86 47 36 75 7 59 74 96 94 82 75 98 4 88 62 56 74 Classes average marks: Class Average 1 77.33 2 74.20 3 50.67 4 82.57 5 70.00 The highest average is 82.57 and it is for class 4. =================================================

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 1PP: (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard...
icon
Related questions
Question
100%

Question 4: (30 marks)
A Math teacher is teaching Math course to a set of classes (each class may have different number of students) and want to check the behavior of his students in a homework report. The teacher gave the classes the same exam and marked their answer and wants to know the class whose students got the highest average. Help the teacher in the required analysis of student’s marks by implementing a Java program ClassAverageMArks2DimmArray using 2-dimensional array to store the students marks and then compute the average of each class student’s marks. The program has the following specification: • A Method titled averageClassMarks for computing the average (as double) of a class students marks (given to the method as a single-dimensional array) • Another Method titled averageAllClassesMarks for computing the average (as single array of double) of all the classes class student’s marks (given to the method as a 2dimensional array). This method has to repeatedly call the first method averageClassMarks to calculate the average of student’s marks in each class. • The program reads from the user the number of classes and then reads the classes student’s marks (as integer values) line by line. Each line has the number of students in the class then the student’s marks. • The program calls method averageAllClassesMarks to calculate all the average values of marks of all the classes. Again, method averageAllClassesMarks has to repeatedly call the first method averageClassMarks. • Finally, the program then prints all the average values (rounded to 2 decimal points) of all classes student’s marks and the highest average mark as well. • The program has to work EXACTLY as given in the following sample run.
Sample Run: Enter number of classes: 5
Enter student's marks of all the classes line by line such that, each line contains first the number of students in a class followed by the student's marks: 6 50 84 76 94 62 98 5 42 64 97 88 80 6 25 35 86 47 36 75 7 59 74 96 94 82 75 98 4 88 62 56 74
Classes average marks: Class Average 1 77.33 2 74.20 3 50.67 4 82.57 5 70.00 The highest average is 82.57 and it is for class 4. =================================================

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning