[SOLVED] RandomGuess

30.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (3 votes)

In Chapter 1, you created a class called RandomGuess. In this game, the application generates a random number for a player to guess. In Chapter 5, you improved the application to display a message indicating whether the player’s guess was correct, too high, or too low. In Chapter 6, you further improved the game by adding a loop that continually prompts the user to enter the correct value, if necessary. As written, the game should work as long as the player enters numeric guesses. However, if the player enters a letter or other nonnumeric character, the game throws an exception. Discover the type of Exception thrown, then improve the game by handling the exception so that the user is informed of the error and allowed to attempt to enter the correct data again. Save the file as RandomGuess4.java.

Criteria:

correctly inserting a try/catch block that will catch non-integer inputs

correctly functioning program

properly formatted source file

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.