Welcome to LQ!
Please review the
Site FAQ for guidance in posting your questions and general forum usage. Asking others to write your full code for you is not the way things work here.
Members here are happy to help you with your homework, but please do not ask them to do it for you. Try to work it out yourself, then ask for help with the parts you do not understand.
Also, please place your code snippets inside [CODE]...[/CODE]
tags for better readability. You may type those yourself or click the "
#" button in the edit controls.