You really aren't meant to ask homework questions, but I guess most people do anyways. Normally you should provide code and ask why a certain part isn't working for you.
As far as your assignment, break it into parts and figure out how to do each individual part instead of trying to just do 6 things at once that are all confusing to you. Try and create simple programs to do each part of that and once you understand it all putting it all together should be simple enough.