Do some research about your problem. Make a design for the program, write some code, compile the code and test it. Fix the problems and repeat.
If you have problems, post your code, the full text...