Haseeb, stop double-posting.
What is this, the third time you've put this exercise on the boards?
We're not here to do your assignments for you, and you're not fooling anybody by registering under multiple user ids.
If there is something that you do not understand in the previous responses, then ask SPECIFIC questions.
Otherwise, go somewhere else for help.
Got the message?