This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Uhm...its hard to go into more detail than your assignment already gives you. People here don't tend to write code for you, rather suggest ways you can write it yourself. But since the question gives you pretty much all the detail you would probaly need, I can't see what else to add. What specifically is confusing you?