Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

Next, it chooses a random number that is >= 1 and<= the maximum number.

i need to wrte a java program named Guess_A_Number that plays a game in which the program picks a

secret number and the user tries to guess it.

The program first asks the user to enter the maximum value for the secret number.

Next, it chooses a random number that is >= 1 and<= the maximum number.

Then the user must try to guess the number.

When the user succeeds, the program asks the user whether or not to play another game.

The following example shows what the user will see on the screen (user input is in bold):

2. Input and output

Guess the secret number.

Enter maximum value for secret number: 10

A new secret number has been chosen.

Enter guess: 3

Too low; try again.

Enter guess: 8

Too low; try again.

Enter guess: 9

Too low; try again.

Enter guess: 10

You won in 4 guesses!

Play again? (Y/N) y

A new secret number has been chosen.

Enter guess: 7

Too high; try again.

Enter guess: 3

Too low; try again.

Enter guess: 5

You won in 3 guesses!

Play again? (Y/N) n

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"