OK, Chong, if reading completed code samples is the best way to learn, then why don't professional teachers do it that way?
The fact is you learn programming by doing it yourself, not by looking at completed code samples. It's too easy to fool yourself after looking at code written by someone else to say "oh that looks easy, I could have done that" - the fact is you COULDN'T do that.
What will the OP do in his exam when he doesn't have you to write his code for him? That might make it easy for him outside exam conditions, but he'll be stuffed when he's in a situation where he has no internet access.