This sounds like a homework problem, in which case no one on this board will do your work for you.
If, on the other hand, you come to us with partially working code, and have specific questions concerning some difficulty encountered, then I'm sure many of the regulars on this board will be willing to help out.