Write a program in C to calculate average test grades for a class. The number of tests per students and the number of students in the class must be variable. That means that your program should accept any number of tests or students (as input data) without any changes in the source code (look at examples below). Other input data will be student names and their test grades. Note that you will have to use nested for loops to solve this problem. Run the program using examples given below, and at least one of your own.
Interactive Session Example:
(prompt - denotes output provided by your program (to distinguish it from user provided data, it should not be printed by your program) :
Example 1 :
-ENTER NUMBER OF STUDENTS IN THE CLASS :
3
-ENTER NUMBER OF TESTS PER STUDENT :
3
-ENTER THE NAME OF STUDENT NUMBER 1 :
BROWN
-ENTER GRADE 1 :
50
-ENTER GRADE 2 :
60
-ENTER GRADE 3 :
70
-
-*******************************************
-* THE FINAL GRADE FOR STUDENT BROWN IS 60 *
-*******************************************
-
-ENTER THE NAME OF STUDENT NUMBER 2 :
JONES
-ENTER GRADE 1 :
70
-ENTER GRADE 2 :
80
-ENTER GRADE 3 :
90
-
-*******************************************
-* THE FINAL GRADE FOR STUDENT JONES IS 80 *
-*******************************************
-
-ENTER THE NAME OF STUDENT NUMBER 3 :
RITT
-ENTER GRADE 1 :
50
-ENTER GRADE 2 :
70
-ENTER GRADE 3 :
90
-
-*******************************************
-* THE FINAL GRADE FOR STUDENT RITT IS 70 *
-*******************************************
-END.
Example 2:
-ENTER NUMBER OF STUDENTS IN THE CLASS :
2
-ENTER NUMBER OF TESTS PER STUDENT :
4
-ENTER THE NAME OF STUDENT NUMBER 1 :
CLOVER
-ENTER GRADE 1 :
50
-ENTER GRADE 2 :
60
-ENTER GRADE 3 :
70
-ENTER GRADE 4 :
80
-
-********************************************
-* THE FINAL GRADE FOR STUDENT CLOVER IS 65 *
-********************************************
-
-ENTER THE NAME OF STUDENT NUMBER 2 :
MOLKS
-ENTER GRADE 1 :
70
-ENTER GRADE 2 :
80
-ENTER GRADE 3 :
90
-ENTER GRADE 4 :
100
-
-*******************************************
-* THE FINAL GRADE FOR STUDENT MOLKS IS 85 *
-*******************************************
-END.