Make an honest effort to solve the problem, post the code here, and we can then take some time to help. In the mean time, it is time to do some internet searches. Wikipedia has a tonne of great articles on many related subjects. Here are a couple of useful links:
Ideally you will do some design before diving into real code - maybe just a list of all the classes and public methods you will need to implement, maybe some pseudo-code to support that?
There are people here who can also review that info before you write too much code, if you would like them to.