I have the following assignment.
Purpose: To use software development principles of abstraction in problem solving and structured problem solving techniques to create an application that uses various control structures and the SecureRandom Java class to create a number guessing game.
Create a class called GuessTheNumber that generates a random magic number between 1 and 10 inclusive. It will then ask the user to guess the magic number, and display one of the following messages:
Your guess is too high
Your guess is too low
You guessed correctly in nn guesses!
If the user guesses incorrectly, indicate if the guess is too high or too low, and continue asking for a guess until the user guesses the magic number. The class should count the number of guesses it took the user, and display that value for nn.
The class should have at least the following two methods:
• public void play() – Which plays the game. The method should create the magic number the user is trying to guess. It should call theaskForGuessmethod to obtain the user’s guess and then check if the user guessed the magic number. If the user didn’t guess the magic number this method should display to the user if the guess was too high or too low, and then ask for a new guess. When the user finally guess the magic number, it should display to the user that they guessed the correct number and indicate how many guesses it took.
• privateintaskForGuess() – Which asks the user for their guess. This method should check that the user’s guess is between 1 and 10 inclusive, and if it is, return the guess. If the user’s guess is not within range, the method should indicate the user’s guess was out of range and continue asking for a guess.
Create a second class called GuessTheNumberTest that contains the main method. The method should create a GuessTheNumber object and call the play method. The class should play the game at least once, and then ask the user if they would like to play the game again. Keep playing the game until the user decides they want to stop.
Upload both source files to Blackboard.
Note: Ensure that your program is properly formatted and it follows all Java naming conventions.
The issue is that I am unable to call the "GuessTheNumberTest" from GuessTheNumber.
Please find my code attcahed