//I am having problems with reading the data from the file. It always outputs //"Invalid file name". I also am having problems with my print_Saverage //function. It always evaluates as true and just prints a 1 instead of the //average of the 5 scores.
int find_Lowest ( int score1, int score2, int score3, int score4, int score5 );
int find_Highest ( int score1, int score2, int score3, int score4, int score5 );
int studentAverage ( int score1, int score2, int score3, int score4, int score5 );
void print_Saverage ( int s_average);
int main ()
{
ifstream inData;
string filename, firstname, lastname;
int score1, score2, score3, score4, score5, s_average;
// int score1[50], score2[50], score3[50], score4[50], score5[50],
// averages[50];
// string first[50], last[50];
cout << "What is the name of the file?" << endl;
int find_Lowest ( int score1, int score2, int score3, int score4, int score5 )
{
if (score1 <= score2 && score1 <= score3 && score1 <= score4
&& score1 <= score5)
return score1;
int find_Highest ( int score1, int score2, int score3, int score4, int score5 )
{
if (score1 >= score2 && score1 >= score3 && score1 >= score4
&& score1 >= score5)
return score1;
int studentAverage ( int score1, int score2, int score3, int score4, int score5 )
{
int lowest = find_Lowest ( score1, score2, score3, score4, score5 );
int highest = find_Highest ( score1, score2, score3, score4, score5 );