Create a program to read in 10 student grades data from file. The file contains student ID and scores for three exams.
Each row should contain 4 columns: here is my example below,
Student ID, Exam1 grade, exam2 grade, exam 3 grade
14524 89 78 95
25437 96 88 95
The program reads the grades for students, calculates average of three exams for each student, and puts out to another file (called Summarygrades.txt) Student ID average and letter grade: example below,
Student Id Average grade Letter grade
14524 87.3 B
...ETC....
Here's what I got so far:
#include
#include
#include
using namespace std;
int main()
{
double studentgrades, x;
ifstream infile;
char studentgrades[10];
//prompt user for file to be opened and declare what you're reading from
cout << "Please enter the student file" << endl;
cin >> studentgrades;
cout << "The file you entered is: " << studentgrades << endl;
//Prompt for error
if (!infile)
{
cerr << " Error opening file.\n ";
exit(1);
}
//file opens
for (int i = 0; i < 10; i++);
{
}
}