This is what I have now and I have 2 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.
#include
#include
using namespace std;
calculateGrade (float,average);
int main ()
{
ifstream infile;
infile.open("C:\inGrade.dat");
outfile << calculateGrade<< endl;
ofstream outfile;
outfile.open("C:\FinalGrades.txt");
infile.close ();
outfile.close ();
system("pause");
return 0;
char calculateGrade (float average)
{
char grade;
if (average >= 80.0)
grade = 'A';
else if (average >= 70.0)
grade = 'B';
else if (average >= 60.0)
grade = 'C';
else if (average >= 50.0)
grade = 'D';
else
grade = 'F';
return (grade);
}
}
2006-12-13
10:26:19
·
3 answers
·
asked by
Ryan G
1
in
Computers & Internet
➔ Programming & Design