Write down in words what the program should do in detail, then translate that into code.
If you know modelling tools, you can use those too.
Make things like state transition diagrams, flow diagrams, etc.
It doesn't really matter, but understand what the code should do and how you want it to do it and quite often the code will start to seem to write itself.
It's hard to explain I know, I don't know how it starts to happen but it does.
It's probably a subconscious process that you need to tap into, once you reach that the actual programming language becomes an implementation detail. While it won't allow you to program in languages you don't know it does allow you to more easily learn languages and use them, to read existing code and understand it.
So start by writing out in words exactly what happens when, and then figure out how your ADT fits into that.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
write it down. How would you solve it on paper?
Forget that computer. Turn off your screen and get pen and paper.
Every problem can be solved without computers, it just takes time (in some cases more time than there is, but the idea is not to solve the problem but to determine HOW to solve it).
Work it out in detail, small steps.
Then when you have all that written down, think of how you'd tell the computer to do each of the small steps you've determined.
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
If you can't write it in english you won't be able to write it in c++.
A quote from my teacher, "the sooner you start to code, the longer the program will take to write".
jasweb2002
Junior Poster in Training
56 posts since Sep 2004
Reputation Points: 11
Solved Threads: 2