Question: a program that reads grade information from a file named grades.txt. There are at most 20 student records in a file; each student will have

a program that reads grade information from a file named grades.txt. There are at most 20 student records in a file; each student will have 5 test scores. Have a 2d array of doubles to hold the test score information. It will have a max size of 20 rows and 5 columns. After reading the data into the array you will need to calculate statistics for each column and display them to the user. To make this easier, you will create the following functions: Function 1 Function Name getHighScoreIndex Parameters scores : double[][5] numRows : int colToAnalyze : int highScoreIndex : int& (by reference) Return Type void Description This function will take the array of scores along with the number of rows and the column that we want to analyze and will find the index for the highest score in the column. This will be put in a reference parameter to be returned. Function 2 Function Name getLowScoreIndex Parameters scores : double[][5] numRows : int colToAnalyze : int lowScoreIndex : int& (by reference) Return Type void Description This function is similar to function 1 except that it finds the lowest score for a column. Function 3 Function Name getAverageScore Parameters scores : double[][5] numRows : int colToAnalyze : int average : double& (by reference) Return Type void Description This function takes the array of scores and calculates the average for a single column. The average is passed back using a reference parameter. Function 4 Function Name getMedianScore Parameters scores : double[][5] numRows : int colToAnalyze : int median: double& (by reference) Return Type void Description This function takes the array of scores and finds the median for a single column. The median is passed back using a reference parameter. To find the median, you will need to copy the column to a 1-dimensional array of doubles. Then you will need to sort that array and find the middle item. If there are an even number of items in the array, then you will need to average the two middle items to find the median. Function 5 Function Name selectionSort Parameters scoreColumn : double[] numItems : int Return Type void Description This function takes a 1d array of doubles and sorts it using selection sort. Use the functions to calculate the statistics for each test and output the results

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 Programming Questions!