Question
This program currently reads a 2D array for grades of students for a specified number of tests. The number of students and tests are entered
This program currently reads a 2D array for grades of students for a specified number of tests. The number of students and tests are entered by the user. Their upper limit is 6 specified the global constants MAX_STUDENT and MAX_TEST, which also define the maximum size of the array. Run this code and understand how the data is being written into and read from an array. This code also displays the average grade for each student. However, there is no code to calculate the averages, youll get garbage values them. Modify the program as follows: a) Implement the functionality that prompts the user for the values of students and tests in a programmer-defined function. Then, fill the 2D array with the user data (the grades) in your function. This function does not need to return anything. Remove this functionality from the main function. b) Implement the functionality that displays the contents of the array. This function does not need to return anything. Your display format should not change when compared with the display of the provided code. Remove this functionality from the main function. c) Write a function that calculates the average grade across the tests for each student. All students take the same number of tests. The code to display the average must remain in the main function, as provided. d) You cannot have any global variables.
3. Passing Arrays to Functions In this lab exercise, we will learn passing array to functions. Consider the following code #include iostream> using namespace std; const int MAX_STUDENT-10; const int MAX_TEST-5; int main() int grades [MAX_STUDENT] [MAX_TEST]; double average [MAX STUDENT1: int students, tests; //Get grades of cout>students; tests?";cin >>tests; for (int 1-0;1?students; ++i) cout >grades[i][jl; //Display grades of the students for (int i-0;iStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started