void calcAverage(int s1, int s2, int s3, int s4, int s5)
{
int sum;
int lowest;
double average;
lowest = findLowest(s1, s2, s3, s4, s5);
sum = s1 + s2 + s3 + s4 + s5 - lowest;
average = sum / 4.0;
cout << setw(4) << fixed << showpoint << setprecision(2);
cout << "The avergae of the four highest scores are: " << average << endl;
}
int findLowest(int s1, int s2, int s3, int s4, int s5)
{
int lowest = s1;
cout << "The lowest test score is: " << lowest << endl;
return lowest;
}
this is what I have so far but I a stuck. The name of the file is grades.txt.
I am trying to get the program to read 5 grades from a file and report back lowest grade that will be dropped and average of 4 left. It runs but is not reading the file. Please help. thank you
ok I think I understand but I am not finding a way to use the void getscore() to read from the file. The file has 5 grades. The program runs but reports long numbers that I did not input so to me that means that the program is not reading from the file