How to make a guessing game


Discuss the below:

Q: I want to make a guessing game. Upon clicking the button on the page, the computer will generate a random number between 0-20. I then should guess the number in the first field.(lets say I have 5 attempts).

The number I guess should be compared with the random generated number. If I guess correctly, the second field could display a message like "you win", else it should display "more" or "less" depending on my guess. If I fail to guess those 5 times, I should lose and the answer should appear in the second field.

2362_The Guessing game.jpg

Solution Preview :

Prepared by a verified Expert
JAVA Programming: How to make a guessing game
Reference No:- TGS01938128

Now Priced at $25 (50% Discount)

Recommended (96%)

Rated (4.8/5)