My apologies, I was being sarcastic. The point I was trying to make is that Chris had given him the pointers where he could research and learn how to do the job. Whereas you gave him the solution, which does not help him learn. If it was a difficult question then the example may have been the best way to answer. As it is an extremely basic question the OP needs to do some learning/research/school work rather than cut and paste your answer. Asking someone to "do the needful" is just plain rude.
Never underestimate the power of human stupidity RAH