#C12916. Calculate Student Average Grade
Calculate Student Average Grade
Calculate Student Average Grade
You are given CSV data containing student records. Each record has the following fields: Student ID, Name, Math, Science, and English. Your task is to compute the average grade for each student using the formula $$\text{Average} = \frac{\text{Math} + \text{Science} + \text{English}}{3}$$, rounded to one decimal place. Then, append a new column named 'Average Grade' to the CSV output. The input is provided via standard input and the result should be printed to standard output.
inputFormat
The input is read from standard input. It consists of CSV formatted text. The first line is the header (with columns: Student ID, Name, Math, Science, English), and each subsequent line is a student record.
outputFormat
Print the updated CSV content to standard output. The output should have the original columns plus an additional column 'Average Grade' in the header. Each student record must include the computed average grade (rounded to one decimal place) appended as the last column.## sample
Student ID,Name,Math,Science,English
1,Alice,80,90,100
2,Bob,70,80,90
3,Charlie,60,70,80
Student ID,Name,Math,Science,English,Average Grade
1,Alice,80,90,100,90.0
2,Bob,70,80,90,80.0
3,Charlie,60,70,80,70.0
</p>