#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
// Function prototype
void getScore(int &);
void calcAverage(int , int, int, int, int);
int findLowest(int, int, int, int, int);
int grades(int, int, int, int, int);
int main()
{
ifstream grades;
grades.open("gr ades.txt");
int testScr1, testScr2, testScr3, testScr4, testScr5;
getScore(testSc r1);
getScore(testSc r2);
getScore(testSc r3);
getScore(testSc r4);
getScore(testSc r5);
calcAverage(tes tScr1, testScr2, testScr3, testScr4, testScr5);
return 0;
}
void getScore(int &score)
{
}
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;
}
it is not reading from the file and returning required info. Please help!
#include <iomanip>
#include <fstream>
using namespace std;
// Function prototype
void getScore(int &);
void calcAverage(int , int, int, int, int);
int findLowest(int, int, int, int, int);
int grades(int, int, int, int, int);
int main()
{
ifstream grades;
grades.open("gr ades.txt");
int testScr1, testScr2, testScr3, testScr4, testScr5;
getScore(testSc r1);
getScore(testSc r2);
getScore(testSc r3);
getScore(testSc r4);
getScore(testSc r5);
calcAverage(tes tScr1, testScr2, testScr3, testScr4, testScr5);
return 0;
}
void getScore(int &score)
{
}
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;
}
it is not reading from the file and returning required info. Please help!
Comment