I am getting zero, the lowest test score is 10 not zero.
I created my own test file with only 10 scores to be able to test my program.
I am certain min should equal 10.
Here is how I read the data into the array after being sure the file opened correctly:
//Read numbers from file into the array.
int count;
for(count = 0; count < SIZE && inputFile >> score[count]; count++);
inputFile >> score[count];
Here is my function prototype
void minMax(double [], int); //Get Min & Max test scores
Here is the function call
minMax(score, SIZE);
Here is the function definition
void minMax(double score[], int SIZE)
{
int count;
int min = score[0];
for(count = 1; count < SIZE; count++);
{
if(score[count] < min)
min = score[count];
}
cout << "Min =" << min;
}
I haven't attempted to get the max yet.
We must write one function and return the min and max values of test scores.
A void function is required, and it must do both.
Any advice?
Kindest regards,
Joseph