Update the function processSchoolReport
to process a school report object that includes detailed class information.
The function should extract the className and the teacher's name, logging them to the console.
It should then retrieve the grades for the first student while storing their remaining details in an object called firstStudentRemaining
. Both the grades and the remaining details of the first student should be logged to the console.
For the second student, the function should extract their name and math grade, storing their remaining subject grades in an object named secondStudentGrades
. These details, including the extracted name, math grade, and remaining grades, should also be logged to the console.
Additionally, the function should extract the total number of students in the class and the attendance records, storing the latter in an array called attendanceRecords
. Both the total number of students and the attendance records should be logged to the console.
Make sure that you maintain the specified order while logging details to the console.