We will be glad to help you...but the key word there is HELP. What have you done so far? how do you think you should approach this? where exactly are you stuck?
We don't know if you need help installing the JDK, editing a source file, compiling it, fixing compiler errors, what the logic should be, why it doesn't run...or any of another million possible things that you may be stuck on.
I would STRONGLY advice you read our FAQ on How To Ask Questions. Then come back and post an update with a good question. You will get more help that you could ever hope for.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors