Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2 Record data processing Write a C program named myrecord.h to process and report mark records. The mark records are given by comma-separated values
Question 2 Record data processing Write a C program named myrecord.h to process and report mark records. The mark records are given by comma-separated values (CSV) format in file marks.txt. Compute the average, standard deviation and letter grades, output results to a file named report.txt. myrecord. h contains the following: Define a structure named RECORD to hold a person's name of 20 characters and the score of float type. Define a structure named REPORT containing fields int count, float mean, float stddev (standard deviation). This function converts a float score to a letter grade according to ranges S=190, 190], A=[80, 90), B=170, 80), C=[ 60, 70), D=150,60), P=10,50), and returns the letter grade. char letter grade( float score); This function importa data from file of name passed by filename, and stores all record entries in an array of RECORD dataset[], and returns the number of records read. int import_data(RECORD dataset [l, char *filename); This function computes the average score, and standard deviation of the score values of dataset[l, and returns the results by the RECORD type. It also outputs name and letter grade to file of name passed by filename, using format "*8, 1c REPORT report data (RECORD dataset[], int count, char *filename); Use the provided test program myrecord_main.c your myrecord.c the screen output is like the following, the screen output is like the following, the output is like this report.txt. Public test gec myrecord.c myrecord_main.c -o g2 g2 count:20 mean: 77.9 stddev: 13.5 Question 2 Record data processing Write a C program named myrecord.h to process and report mark records. The mark records are given by comma-separated values (CSV) format in file marks.txt. Compute the average, standard deviation and letter grades, output results to a file named report.txt. myrecord. h contains the following: Define a structure named RECORD to hold a person's name of 20 characters and the score of float type. Define a structure named REPORT containing fields int count, float mean, float stddev (standard deviation). This function converts a float score to a letter grade according to ranges S=190, 190], A=[80, 90), B=170, 80), C=[ 60, 70), D=150,60), P=10,50), and returns the letter grade. char letter grade( float score); This function importa data from file of name passed by filename, and stores all record entries in an array of RECORD dataset[], and returns the number of records read. int import_data(RECORD dataset [l, char *filename); This function computes the average score, and standard deviation of the score values of dataset[l, and returns the results by the RECORD type. It also outputs name and letter grade to file of name passed by filename, using format "*8, 1c REPORT report data (RECORD dataset[], int count, char *filename); Use the provided test program myrecord_main.c your myrecord.c the screen output is like the following, the screen output is like the following, the output is like this report.txt. Public test gec myrecord.c myrecord_main.c -o g2 g2 count:20 mean: 77.9 stddev: 13.5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started