#C14826. Student Scores Analysis
Student Scores Analysis
Student Scores Analysis
You are given a CSV formatted text representing student records. The first line is the header with the following fields: student_id
, student_name
, test_score
, and grade
. Each subsequent line contains information for one student.
Your task is to generate a summary report that includes:
- The average test score for each grade, rounded to two decimal places when necessary.
- The highest and lowest test scores for each grade.
- The overall highest and overall lowest test scores across all valid records.
If a record does not contain a valid test score (either missing or non-numeric), ignore that record. If there are no valid scores for any grade, then that grade should not appear in the summary and the overall highest and lowest scores should both be 0.
Note: All any formulas you use (if any) should be expressed in LaTeX. For instance, the average for a set of scores \(S = \{s_1, s_2, \ldots, s_n\}\) is computed as \(\frac{\sum_{i=1}^{n}s_i}{n}\).
inputFormat
The input is read from standard input (stdin) and consists of multiple lines forming a CSV file. The first line is a header, and each subsequent line contains a student's details.
outputFormat
For each grade that has valid scores, output one line in the following format:
<average_score> <highest_score> <lowest_score>
The lines must be sorted in lexicographical order by the grade. Finally, output an extra line in the format:
Overall <overall_highest_score> <overall_lowest_score>
Note: Do not output any additional text.## sample
student_id,student_name,test_score,grade
1,John Doe,85,A
2,Jane Smith,90,B
3,Bob Johnson,76,A
4,Lucy Brown,88,B
5,Tom Hanks,65,C
A 80.5 85 76
B 89 90 88
C 65 65 65
Overall 90 65
</p>