First of all, when posting code, please use the highlight tags to preserve formatting.

Secondly, what part of this is giving you trouble? What have you tried? Where are you stuck?