(1) The number of the students in your class is a random number between [131, 162].
(2) Every student has 3 exams, and each exam grade is a random integer between [10, 100].
(3) A student's total grade is the average of the three exam grades.
(4) If the total grade is in [10, 59], the letter grade is F; If the total grade is in [60, 74], the letter grade is C; If the total grade is in [75, 84], the letter grade is B; If the total grade is in [85, 100], the letter grade is A.
Requirements:
(1) you need to use a 2-dimensional array to store all the grades for the students. For eachs student, you need to store her student number (a number ranging from 1 to the total number of student), her grades for three exams, and her final grade.
(2) You first need to print the maximum and minimum grades for each exam, and the corresponding student number.
Output can look like:
Exam 1 maximum Student number
100 24
Exam 2 minimum Student number
10 165
(3) You need to sort all the students based upon their final grades in the descending order. Then print the
sorted list in the following format (I show a sample output below):
Student Number Final Grade Letter Grade
24 100 A
17 98 A
160 95 A
(4) Finally, you need to add a student into the list if the class is not full yet (maximum size is always 162). Again, you need to randomly generate this student's grades for 3 exams and calculate her total. When you insert, make sure the sorted order on the total grade is obeyed.
Then you need to print out the new list (in the same format above). On your print out, please put a "start sign" to indicate which one is the new student.
At last, please use getchar() at the end of main function so that the output window will stay.
Can anyone pls kindly give me an idea how to set this up ???
I would say start with (1) under requirements. That list of "requirements" almost seems like a list of steps on how your program might look.
Start by implementing that array and maybe set up a test case to know that it works like you think it should. From there you can start brainstorming on how to store and access a student's information. i.e. the 2-D array has [x][y] where x is the student number, and y is an index of each exam's grade or something similar.