|
--------------------------------------------------------------------------------
Hi, can I know the coding for the below situation.
Basically, I want to ask the user to enter the desired data, for instance name. Then I proceed to ask the user to enter his age (between a certain range). The problem is that how do I prompt the user to reenter the correct data, while clearing the data that has been previously entered and displayed, and at the same time, make sure that his name is not cleared.
It goes something like this.................
__________________________________________________ _______________ Please enter your name: Jack Johnson
Please enter your age : 900
You entered over 100 years. Enter again. __________________________________________________ _______________
Since data entered is not in the allowable range, prompt the user to enter again.
__________________________________________________ _______________
Please enter your name: Jack Johnson
Please enter your age :
__________________________________________________ _______________
All I know is that only one command can be used to clear the screen, ie, system("cls"). But if I use this, it will clear the first line as well.
Please help.
|