Question: I would like to write a program that processes grade data using structures. Use scanf to input data and printf to output the results. gotta
I would like to write a program that processes grade data using structures. Use scanf to input data and printf to output the results. gotta use C++ .
I would like the program to use two data structures to read in student grade data, perform some calculations, sort the students in ascending order by average, determine some class statistics, and output the results. The first data structure is classStats and should have variables mean (float), min (float), max (float), median (float), and name (character pointer).
create one variable of type classStats (not a pointer) in the main program. The second data structure is called student and will have variables first (character pointer), last (character pointer), exam1 (integer), exam2 (integer), exam3 (integer), and mean (float). This structure is in the file student.h.
Need to create an array of 19 student pointers and will need to allocate space for each in your main program using malloc(). The data file contains the name of the course followed by 19 students, each student having three exam grades. Use the array of student pointers to store the information as read in using scanf
Erica Sanders 75 89 67
Kelley Cummings 74 70 79
Jamie Reynolds 64 52 66
Shawna Huff 80 88 61
Muriel Holmes 81 74 79
Marion Harmon 77 64 69
Catherine Moss 51 80 73
Kristin Fernandez 86 69 81
Elsa Alvarado 63 77 67
Cora Spencer 76 79 71
Valerie Olson 85 78 79
Anne Singleton 85 87 65
Rene Boone 85 85 77
James Morgan 69 86 51
Cedric Haynes 72 73 88
Elijah Snyder 65 92 91
Roger Howard 79 95 71
Archie Black 70 81 63
Melvin Watkins 66 67 72
Use the three grades to determine the student's mean and store it with the name and exam grades in the student structure. Assumed each exam is weighted the same. Once all the students are read in and the averages determined, the students using the bubble sort code in bubble.c, which takes an array of student pointers and the array size as arguments.
After sorting the students based on mean, find the mean, minimum, maximum, and median of the grades and store them in the classStats structure.
Use printf to output the data.
thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
