Semester Exam Report Each Semester 3 Exams Are Taken By Each Student Create Functions To Determine The Class Average H 1 (68.75 KiB) Viewed 55 times
Semester Exam Report Each semester 3 exams are taken by each student. Create functions to determine the class average, highest grade and lowest grade for each exam. The requirements are - 1) Create a function to read in 3 grades for each student. A 2D array int stuGrades [MAX_STUDENTS) (TOTAL_TESTS] must be used to hold all the grades for each exam for all the students, where MAX STUDENTS and TOTAL_TESTS are defined as - const int MAX_STUDENTS=24; //max students allowed const int TOTAL_TESTS=3; //3-test per a student const int TOTAL_NUM_STAT=3; //AVG, MIN, MAX //make sure to validate each grade. Grade must be in between 0 and 100. void readStuGrades (int stuGrades [] [TOTAL_TESTS], int &numStu); 2) Create a function to print out the grades for all students. void printStuGrades (int stuGrades [] [TOTAL_TESTS], int numStu); 3) Create a function to determine the class average, highest grade and lowest grade for each exam. void getExamAvgMinMaxGrade (int stuGrades [] [TOTAL_TESTS], int numstu, int exam, float &avg, int& low, int& high); 4) Create a function to print out the results for each test. void printExamOverview(int stuGrades [] [TOTAL_TESTS], int numStu); This function will call getExamAvgMinMaxGrade() to get the class average, highest/lowest grade for each exam. Then it will save the data in a 2D array defined as float examStat[TOTAL_TESTS) (TOTAL_NUM_STAT); For example, for the first exam examStat[0][0] represents the class average for the first exam examStat[0][1] represents the lowest grade for the first exam examStat[O] [2] represents the highest grade for the first exam
The function will print out the semester grade report as shown below. The average grade will have 2 decimal places. F:\ETS75Project Project2_gradingArrays.exe SEMESTER GRADE REPORT Please enter 3 integer grades (0-100) below. 100 299 300 Invalid grade(s). Please re-enter. Please enter 3 integer grades (8-100% below. +1 100 100 Invalid grade(s). Please re-enter. Please enter 3 integer grades (0-100) below. 70 80 90 More student? Enter 'l' or 'y' to continue or any letter to exit. Y Please enter 3 integer grades (0-100) below. 65 75 85 More student? Enter 'Y' or 'y' to continue or any letter to exit. Please enter 3 integer grades (0-100) below. 88 77 66 More student? Enter 'Y' or 'y' to continue or any letter to exit. y 0 Student Exam 2 Exan 1 70 65 88 Exam 3 90 85 66 80 75 27 WN 75 66 LOWEST HIGHEST AUG 65 88 74.33 89 90 LOS 77.33 89.33 EXIT PROGRAM. GOODBYE! 1) Do not use any library functions such as min() and max(). 2) Add comments to explain the algorithm of your program. 3) Keep your project coding clear with your own programming style.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!