Question: Write a java application that simulates the Guess my number game Game Description The game consists of generating a hidden random number between 1 and

 Write a java application that simulates the "Guess my number" game

Write a java application that simulates the "Guess my number" game Game Description The game consists of generating a hidden random number between 1 and 32, by the program and displaying the message "A number between 1 and 32 is generated. You have 5 chances to guess it. Please, enter your guess". If the user enters the correct guess within the 5 tries, the program displays the message "Bravo, You got it!! Do you want to play again?". For each wrong guess, within the 5 permitted tries, the program displays either Too large! Try again ", if the guessed value is larger than the generated one or Too small! Try again ", if the guessed value is smaller than the generated one. After 5 wrong guesses, the program displays the message "Sorry, you lost!! Do you want to play again?". If the user enters Yes, the program generates a new hidden random number between 1 and 32 and repeats the whole process, if the user enters No, the program displays the number of times the user played the game and the success percentage. For example if the user played 5 times and won 3 times the program displays the following message: "You played 5 games and you have a success rate of 60.00%". Additional Requirements The communication with the user should be done using JOptionPane class static methods 1. 2. The program displays error messages whenever the user enters non valid response

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!