I can't seem to figure out how to read from a text file and to fill an array.
For example, lets say that my text file looks something like this:1234P
100 100 100 100 100 100 100 100 100
100 100
100
15
2381
P
100 100 100 100 100 100 100 100 100
100 100
100
15
3452
N
100 100 100 100 100 100 100 100 100
100 100
100
15
.
.
.
.
.
etc.
The first number is the student ID, followed by a Pass/No Pass on class assignments, 9 homework scores, 2 midterm scores, the final, and extra credit. I have 11 ID's and grades in the file. I'm supposed to scan the ID's and put them into an array. Then scan the grades (the algorithm is determined by adding up the average of each and making sure that the student meets basic requirement, ie homework must be over 80%, midterms over 60, etc)
How the HECK do I go about doing this? I've been trying many methods of code and NOTHING seems to work for me. Its depressing. I did manage to open the file successfully... haha.
How would I link which score is to which ID? How do I go about scanning in each line? I CANT EVEN SCAN IN THE ID's into the array for Pete's sake. Yes, I'm getting a little hysterical. Sorry. Anyway, I do have code written up, some is commented out since I've been trying so many approaches. But frankly, it looks like codevomit. But if it would really make a huge difference, let me know and I'll post it up.
Thank you for your time! I know this is a lot to read, but I'm desperate to get this program to work!



LinkBack URL
About LinkBacks


