I have a problem. I got my file to open but I don't know how to modify the file and have the output I need. Here is my code so far
#include <fstream>
#include <iostream>
#include <cstdlib>
int main()
{
using namespace std;
ifstream input;
ofstream output;
input.open("input.txt");
if (input.fail())
{
cout<<"Input file opening failed.\n";
exit(1);
}
output.open("grade.txt");
if (output.fail())
{
cout<<"Output file opening failed.\n";
exit(1);
}
input.close();
output.close();
return 0;
}
i'm supposed to add the total of scores...average them and have the program tell me who has the highest and lowest averages of the students.