Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What is the principle of thermodynamics? Explain with examples

Answered: 1 week ago