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?