Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need help with user input

 
Ken Ng
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all, can someone help me with the following problem.
(console application)
1. What is the code to "erase" (delete) a user input
-Consider the prompting message,
Enter choice (1,2 or 3) here: _
-If user enter an invalid value and press Enter,
Enter choice (1,2 or 3) here: 4
-The entered valued 4 will sort of "backspaced" and the prompt statement remains waiting for another input,
Enter choice (1,2 or 3) here: _

2. What is the code to clear screen like the cls command used in the command prompt, e.g consider the following display.
1. Convert time to seconds
2. Display help info
3. Exit
Enter choice here: 1
Enter hour: 1
Enter minutes: 30
Enter seconds: 30
No. of seconds is 5430
Press ENTER to continue _
-When user press Enter, the screen is cleared and the original prompting message remains waiting for next input.
1. Convert time to seconds
2. Display help info
3. Exit
Enter choice here: _
Many Thanks to anyone for the help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic