Hi,
This sounds like homework. (It makes no sense that we do your homework. But we will help you to rectify mistakes)
Similar questions have been discussed earlier in this forum.
So do a forum search to get ideas (this is how a forum is meant)
The key tasks are:
* To divide the big task into smaller tasks
* you should have an idea how to solve the smaller tasks.
* maybe it's necessary or useful to divide the smaller tasks in even smaller tasks.
* write down your ideas - I often use pencil and paper for this
Then show us what you have done so far.
Then ask elaborated questions. Max three per post.
Klaus