Beginner in C++: Inputting data files, and arrays help?

"This program will read grades from two different files (one at a time) and do some simple analytical operations on those grades -- identifying the maximum, minimum, median, and mean."

"Information about the scores will be stored in an array. But, the array will not hold the scores themselves -- instead it will record the number of occurrences of each particular score."

So, I have an assignment where I need to input 2 datafiles, "data1.txt" and "data2.txt", and find the max, min, median, and mean. I need to use the main function, as well as readData and analyzeData functions.

The readData function opens and reads the specified data file, counting the scores that are found inside.


fileName: (string input) the name of the file to read
dataCounts: (integer array output) the scores found in the file
totalScores: (integer output) the total number of scores found

The analyzeData function analyzes the data described by the array given to it, computing desired statistics


dataCounts (integer array input) describes the values of data
totalScores (integer input) the number of scores described
maximum (integer output) the maximum score
minimum (integer output) the minimum score
median (integer output) the median scores
mean (double output) the average (mean)

Please consider giving me as little or as much help as you would like. Any helpful hints or nudges in the right direction are welcome, as well as program snippets and insight. Thank you.
Shameless self bump.
Topic archived. No new replies allowed.