The OP has violated almost all of the major rules of netiquette when posting.
Basically, he posted saying
"Boo-hoo woe is me! I've got a homework problem I can't do because I'm too lazy or because I haven't paid enough attention in class. Now I'm going to get a bad grade.
Please someone write it for me. Oh, and send it to loser@gmail.com."
Zhuge responded exactly right: make an effort, post some real work, identify actual problems, ask for assistance in learning, etc -- and sure, we'll help.
helios likewise was even a bit more helpful -- pointing him to another thread on the exact same assignment (where
Ima noob at least made
some effort and showed that he was thinking about the problem).
The OP's response was negative: "What? You aren't just going to give me the answer? *insert favorite explicative* to you!"
Real hackers resent such arrogance. ESR has even gone to the lengths of writing a short treatise on the subject:
How To Ask Questions The Smart Way -- this is oft-linked and simply-put, just plain part of standard knowledge.
http://catb.org/esr/faqs/smart-questions.html
Our very own forum has an abridged version stickied:
http://www.cplusplus.com/forum/articles/1295/
I must admit, however, I was in a rather foul mood when responding last.