1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
void GradingSystem::ReadFile() {
fstream InFile(FileName.c_str(), ios::in);
getline(InFile, Line1);
getline(InFile, Line2);
// I didn't really see why you do this
Number = 0;
// here you make a buffer for I don't what?
double Buffer = 0;
// Then again have more buffers
double TempQ1 = 0,
TempQ2 = 0,
TempQ3 = 0,
TempQ4 = 0,
TempQ5 = 0,
TempM1 = 0,
TempM2 = 0,
TempE1 = 0;
double FakeId = 0;
// StuName is never set.
string StuName;
InFile >> Buffer;
FakeId = Buffer;
// now the long list of buffer = buffer
InFile >> Buffer;
StuName = Buffer;
InFile >> Buffer;
TempQ1 = Buffer;
InFile >> Buffer;
TempQ2 = Buffer;
InFile >> Buffer;
TempQ3 = Buffer;
InFile >> Buffer;
TempQ4 = Buffer;
InFile >> Buffer;
TempQ5 = Buffer;
InFile >> Buffer;
TempM1 = Buffer;
InFile >> Buffer;
TempM2 = Buffer;
InFile >> Buffer;
TempE1 = Buffer;
List.push_back(Student(FakeId,
StuName,
TempQ1,
TempQ2,
TempQ3,
TempQ4,
TempQ5,
TempM1,
TempM2,
TempE1));
cout << Line1 << endl << Line2 << endl;
// doesn't print anything else, but I have a feeling you wanted to see more.
}
|