I answered a very similar question not that long ago: Reading input from user - #3 by jmrunkle
Check that topic and come back here if you still have questions.
I answered a very similar question not that long ago: Reading input from user - #3 by jmrunkle
Check that topic and come back here if you still have questions.