I have been stuck for awhile trying to read the data in my file. As you can see, I haven't did much coding, but I would appreciate the assistance if someone can tell me what is wrong with the code. Thanks!
Example of my input file:
Kay, Harry 95 A
Barnes, Mary 88 B
Cartwright, Matt 75 C
Downes, Ryan 80 B
Fields, Whitney 69 D
Here is my code:
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
struct studentType
{
string studentFName;
string studentLName;
int testScore;
char grade;
};
void init (studentType students[]);
void assignGrades (studentType students[]);
void highestTest (studentType students[]);
void printHighest (studentType students[]);
int main()
{
studentType students[5];
init(students);
assignGrades(students);
highestTest(students);
printHighest(students);
system ("PAUSE");
return 0;
}
void init (studentType students[])
{
for (int i = 0; i < 1; i++)
{
ifstream inData;
inData.open("Unknown.txt");
inData>>students[i].studentLName;
inData>>students[i].studentFName;
inData>>students[i].testScore;
inData>>students[i].grade;
inData.close();
}
}
void assignGrades (studentType students[])
{
}
void highestTest (studentType students[])
{
}
void printHighest (studentType students[])
{
}