mat. 3. Create a function called StdGPA that a 2D array (StdA), its size, and an integer value (indexSt) and does the following: a. Check if size and indexSt are in a proper range. If not Print a message for the user. b. Compute and return the average grades the student indexSt. 4. Create a function called MaxGPA that that a 2D array (StdA) and its rows and cols (row and col) and does the following: a. Check if row and col are in a proper range. If not pri
Develop a C program that does the following:
1. Define the global symbolic constants ROWS with value 3 and COLS with value 4.
2. Create a function named PrintArray that receives a 2D array (StdA) and its rows and cols (row and
col) and does the following:
a. Check if row and col are in a proper range. If not Print a message for the user.
b. Print StdA in a tabular format.
3. Create a function called StdGPA that a 2D array (StdA), its size, and an integer value (indexSt) and
does the following:
a. Check if size and indexSt are in a proper range. If not Print a message for the user.
b. Compute and return the average grades the student indexSt.
4. Create a function called MaxGPA that that a 2D array (StdA) and its rows and cols (row and col)
and does the following:
a. Check if row and col are in a proper range. If not print a message for the user and return
-1.
b. Declare a 1D array called StudentGPA of size row.
c. Call StdGPA for each student in StdA to fill StudentGPA.
d. Find the maximum GPA in StudentGPA.
e. Return the index of student that has the maximum GPA.
5. Create a function called ValidateValue that receives a float value (grade) and returns 1 if grade is
greater than or equal 35 and less than or equal 100. Otherwise, it returns 0.
6. In the main function:
a. Declare a 2D float array of size ROWS x COLS called Students.
b. Fill Students with their grades in 4 courses from the user. Ensure that all values in
Students are between 35 and 100 using ValidateValue function.
c. Call PrintArray and pass Students and its size (rows and cols).
d. Call MaxGPA and pass Students and its size (rows and cols) to find the student (indexStd)
that has the maximum GPA.
e. Compute and print the GPA of the student (indexStd) using StudentGPA function.
Step by step
Solved in 2 steps