September 2011
Beginner
650 pages
15h 47m
English
Try This 3-2 Improve the Java Help System
Help2.java
This project expands on the Java help system that was created in Try This 3-1. This version adds the syntax for the for, while, and do- while loops. It also checks the user’s menu selection, looping until a valid response is entered.
1. Copy Help.java to a new file called Help2.java.
2. Change the first part of main( ) so that it uses a loop to display the choices, as shown here:

Notice that a nested do- while loop is used to discard any unwanted characters remaining in the input buffer. After making this change, the program will loop, displaying the menu until the user enters a response that ...
Read now
Unlock full access