This is a stupid question but my memory isn't what it used to be. Ive had this working before but I deleted part of the code. At around line 58-60, I am trying to verify that the lines of text from the text file StudentFile are assigning to the variables FirstName, LastName, etc...by printing it to the screen. It was a simple little snippet but for the life of me, I cant remember how it worked. Please remind me.
This is what the text file looks like:
Harry Houdini 1212 3 MAG101 A PRES201 A ESC301 A
Henry Ford 2211 2 MFG110 A SAL202 B
Albert Einstein 1155 1 CALC100 F
Alan Turing 9082 4 CSC110 A CSC201 A CSC210 A CSC205 A
Melvil Dewey 1876 2 LIBM102 C SUPV202 D
ok coder777, I made a few tweaks but I'm not understanding 2 things and how to get there.
Firstly, the next lines of the text file are not being written to the structure, partly I think because that is not the end of the line. The tricky part (no 2 on my list of misunderstood items) is that the text after "NumberofGrades" changes. What I planned to do was repeat a loop "NumberOfGrades" time and assign the following info into the "grades" structure. I am eventually gonna need to match that info with a Hours text file and calculate the GPA based on that comparison.
tricky part is that I will need to match each course number with a course number in the an hours file and extract the credit hours to multiply to get the GPA.
question in your replay above: what does the and statement do? check to see if the FirstName, LastName, StudentID and NumberOfGrades?
NumberOfGrades will be used to determine hoy many times I need to loop through the last items of each line of text in the students.txt.