simple data structures w/ arrays
Posted on 2005-04-13
I have this little program ive made, its with simple structrues and uses arrays..
the program is compliing fine but does not give me the expected output, ive looked at it for a while now and still cant seem to figure it out. its not writing out to the output file like its supposed to, everytime i try to run it, it gives me an error.
using namespace std;
const int SIZE = 20;
void ReadRecords(Student, ifstream&);
double CalculateGpa(int creditPts, int creditHrs);
void WriteOut(Student, ofstream&);
for(int i=0; i<3; i++)
void ReadRecords(Student record, ifstream &inFile)
for (int i=0; i<files; i++)
double CalculateGpa(int creditPts, int creditHrs)
void WriteOut(Student record, ofstream& outFile)
for (int i=0; i < SIZE; i++)
outFile<< "NAME: " << record[i].name << endl;
outFile<< "GPA : " << record[i].gpa << endl;
the input file looks like this:
3433 433 44
3442 454 33
5332 353 23
its supposed to print out the the name and the GPA of all the students.