Do you have a design for the program? Can you list the steps it must take to solve the problem?
You need a design for a program before you can write it.