dariaveltman
please tell what am I doing wrong.
First, please let us know what you are confused about. If you don't know exactly where you are confused in the code or how the code is supposed to work try telling us what you already do know and how you got there. This will help us understand exactly where you were left off as we can continue the discussion from that point instead of possibly repeating something that you may already know.
roc.ky89
I hope this will help you :)
wanna know concept?
I think your post is slightly inappropriate as we should be leading the OP towards his own conclusion instead of telling him the exact answer. By just telling him, they learn nothing. This does not help them later in the future when this type of exercise would have built a better programming structure for the programmer.
Second, you copied and pasted someone elses code. Granted, you did link a site to the page but not until you scroll down do we realize it was copied and pasted from this page. We don't, or at least I don't, expect you to paste it in MLA format, but a simple (CODE WAS COPIED FROM THIS SITE) would have been sufficient.