Question: using C write a code for: int report_data(RECORD dataset[], int count, char *filename); computes the letter grades of dataset[], average score, standard deviation, and median,
using C write a code for:
int report_data(RECORD dataset[], int count, char *filename); computes the letter grades of dataset[], average score, standard deviation, and median, and outputs the results to file of name passed by filename.
marks.txt
Myrie,76.7 Hatch,66.5 Costa,45.1 Dabu,74.4 Sun,67.7 Chabot,80.4 Giblett,59.1 Suglio,85.7 Smith,60.1 Bodnar,93.6 Allison,67.7 Koreck,77.4 Parr,92.5 Lamont,98.1 Peters,82.3 Wang,98.1 Eccles,77.8 Pereira,80.3 He,85.7 Ali,88.0
code:
int report_data(RECORD dataset[], int name, char *filename) {
// your implementation
// fprintf(fp, "%-15s%c ", dataset[i].name, letter_grade(dataset[i].score));
// compute mean, standard deviation,
// fprintf(fp, " Stats summary ");
// fprintf(fp, "%-20s%d ", "count:", n);
// fprintf(fp, "%-20s%3.1f ", "average:", mean);
// fprintf(fp, "%-20s%3.1f ", "standard deviation:", stddv);
// compute median
// create float array a[n], sort array a[n] using quick sort
// then calculate the median
// fprintf(fp, "%-20s%3.1f", "median:", median);
}
results should look like this:
Letter grade Myrie B Hatch C Costa F Dabu B Sun C Chabot B Giblett D Suglio A Smith C Bodnar A Allison C Koreck B Parr A Lamont A Peters B Wang A Eccles B Pereira B He A Ali A
Stats summary count: 20 average: 77.9 standard deviation: 13.5 median: 79.1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
