HELP with a C++ program reading students grades from an infile and outputing the results to outfile?
I have to write a program the reads students grades together with their test grades. It suppose to compute the average test scores an then assign the appropriate grade. have to use a void function to determine the average for the five test scores and a value returning function to determine and return each students grade. the students grades are on an infile and i have to output it to an outfile.
This is what i have:
Code:
#include <iostream>
#include <fstream>
using namespace std;
calculateGrade(float);
int main ()
{
ifstream infile;
infile.open("C:\inGrade.dat");
ofstream outfile;
outfile.open("C:\FinalGrades.t...
calculateGrade()
infile.close ();
outfile.close ();
system("pause");
return 0;
}
void calculateGrade(string, float)
{
if (average>=90)
outfile<<"A"<<endl;
else if(average>=80)
outfile<<"B"<<endl;
else if (average>=70)