"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Try This: Complete the Java help system

Try This: Complete the Java help system

Published on 2024-08-09
Browse:971

This version adds break and continue syntax.
It also allows the user to request the syntax of more than one statement. It does this by adding an external loop that runs until the user enters q as a menu selection.

  1. Copy Help2.java into a new file called Help3.java

  2. Include all program code in an infinite for loop. Exit this loop, using break, when a letter q is inserted. Since the loop encompasses all of the program's code, exiting it causes the program to terminate.

  3. Change the menu loop as shown here:
    Image description

Note that this loop now includes break and continue statements. It also accepts the letter q as a valid option.

  1. Expand the switch statement to include the break and continue statements, as shown below: Image description
Release Statement This article is reproduced at: https://dev.to/devsjavagirls/tente-isto-3-3-termine-o-sistema-de-ajuda-java-1d04?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3