Can you explain your problem?
Are you trying to write pseudo code for the program
or are you trying to write the program?