Pen and paper are my best friends when it comes to planning.
I write down exactly what I need to accomplish, I start writing where the program begins and the steps it's going to go through to get to the end result, while doing this I end up asking myself a ton of questions which I also write down. Things like "What if the user enters the wrong filename here? What should happen?" and "What happens when this file closes, should I process after or as I read in each line?"
edit:
These questions I ask myself end up dictating most of the program flow/design, and also leads to early bug development.
Much like TDD (test driven development) only your going over the tests to fail in your head and on paper before any coding takes place.
You are required to design four classes:
nameType, dateType, personType and studentType
in respective header files
nameType.h, dateType.h, personType.h and studentType.h
|
That's quite an annoying restriction, but really this is probably what you should do anyway if designing it for yourself.
In the implementation of those functions, you need to use the overloaded stream insertion operator (<<)
and extraction operator for studenType.
|
I'm not sure if that means you need to define an overloaded operator or just use "the insertion operators", you will know better than me, but I'm guessing that you need to read each line in the file and store in each subsequent array element.
Simple Answer: I'd read the file in when you need to use it.