soruyu tam cevirememis olabilirim. sorunun orijinalini veriyorum ve icerisinde ornek ciktilarda mevcut.
Write a Java program that plays a number guessing game with the user. Your program asks the user to set the high end of the range, and then your program gets a secret random number inside the range. The user then repeatedly guesses what random number your program has, until she gets it right. Your program gives her hints along the way: "Too high." or "Too low".
Below is a sample output from one run of the program. Your output has to match this one exactly, except of course that the answer that your Random object chooses will be different. User input is big and bold.
We are going to play a number guessing game.
You are going to guess a number between 1 and what number? 10
Type a number between 1 and 10: 5
Too high. Try again: 3
Too high. Try again: 2
RIGHT! It took you 2 tries.
Would you like to play again? y
You are going to guess a number between 1 and what number? 20
Type a number between 1 and 20: 10
Too high. Try again: 5
Too high. Try again: 3
Too high. Try again: 2
RIGHT! It took you 3 tries.
Would you like to play again? n
If you study the run above, you will see that the user gets to play the game as many times as she wants, and each time she plays the game, she:
• chooses the high value in the range that she will be guessing.
• is allowed as many tries as needed to guess the correct random number.
• gets feedback that helps her by telling her if her previous guess was too high or too low.
• is shown how many tries it took her to get the right answer in the end.
You must have a class Game, that represents one play of the Game. That is, one object represents one play of the game, which keeps track of one randomly generated number in a range, and one play with the user; this one play of the game allows the user as many tries as necessary to guess that random number.
You must also have a second class called Main that repeatedly asks the user if she wants to play (again).