Originally Posted by STLDude
If this is work, they yes, both steps need to be completed and in principal it does not matter which one first.
My main point here was that; I see this quite often coming from students where they have home work assignment as in this case who are fairly new to programming, not having much or any experience and just make harder on themselves by mixing file input and the logic of the assignment, with end results being that it took far longer to finish.
If you read over this thread you will see that even seemingly simple think like reading from the file was given wrong advice. The end result of the assignment is to calculate something, etc, thus do that first (using stable hard coded data) and just in case you run out of time before your due data you at least got it done in spirit, and as teacher I would far more impressed with that piece, rather then student showing me just reading data from the file.
Again, please do not mix what I'm saying here with professional work environment, this is mostly geared towards student.