Question: float get_section_average(char *filename, int section_num); This function will open a datafile whose name will be passed as an argument in filename, read the records, and

float get_section_average(char *filename, int section_num);

This function will open a datafile whose name will be passed as an argument in filename, read the records, and calculate the average score of all students enrolled in section_num. That is, for each student, you will check to ensure that the section number (last field) matches section_num. If it does, then you will add their score (third field) to a total sum and increment a counter tracking the number of students enrolled in the section. Once all records have been read, you will divide the sum by the number of sutdents enrolled and return the class average.float get_section_average(char *filename, int section_num); This function will open a datafile whosename will be passed as an argument in filename, read the records,and calculate the average score of all students enrolled in section_num. That

The Big Idea At the end of a semester there comes a time when letter grades have to be assigned to students in cS 240. To help out the process, we've created a database that contains various student information including grades Given this database, users can formulate queries using specific constraints to extract valuable informationfrom the raw data unprocessed information). In this homeworK, We Will manipulate some of the data contained in this "grade database." You will design a simple set of database query functions that will: - calculate the overall average score for a given section Determine the top score out of all sections Generate a list of students scoring lower than a provided cutoff threshold for all sections Generate a final grade report based on predetermined cutoff thresholds for a given section Examine "hwi.h" carefully. It contains declarations for the global variables, constants, and the prototypes for the functions you will write The Assignment The necessary information about opening/reading from/writing to files is both in the class text and the lecture slides. Functions YouWill Write You Will wrlte the Tollowing Tunctions: float get_section_average(char *filename, int section_num); This function will open a datafile whose name will be passed as an argument in filename, read the records, and calculate the "average score" of all students enrolled in section_num. That is, for each student, you will check to ensure that the section number (last field) matches section_num. If it does, then you will add their score (third field) to a total sum and increment a counter tracking the number of students enrolled in the section. Once all records have been read, you will divide the sum by the number of sutdents enrolled and return the class average. int get_top_score (char *filename); This function will open a datafile whose name will be passed as an argument in filename, read through all records, and return the maximum final score out of alIsections

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!