Texts: I'm not getting the correct output. Help.
Design and implement a one-person guessing game that chooses n random integers in the range from I to m and asks the user to guess them. The same integer might be chosen more than once. For example, the game might choose the following four integers that range from I to 10: 4, 6, 1, 6. The following interaction could occur between the user and the game:
Enter your guesses for the 4 integers in the range from 1 to 10 that have been selected: > 1234
2 of your guesses are correct. Guess again: > 2468
2 of your guesses are correct. Guess again: > 1466
You are correct! Play again? No. Goodbye!
Design the game as an ADT. Use a bag to contain the integers chosen by the game. The integers m and n are specified by the client.
How to do it?
1. You need to create your class with the name GuessingGame and save the file as GuessingGame.java.
2. You need the main method in the GuessingGame class file.
3. You need to make sure that ArrayBag.java, GuessingGame.java, and BagInterface.java are all in the same folder so you can create an object with the type of ArrayBag to contain the integers chosen by the game. (For example, BagInterface<String> aBag = new ArrayBag<>(4) creates a bag that holds 4 items).
4. In the implementation of GuessingGame, you need to make sure to use the ADT ArrayBag public interface in the ArrayBag when you are looking for an item in the bag (For example, aBag.isEmpty() or aBag.contains("Jack")).
5. Use Scanner to read from the user.
6. Generate a random number. For example, int number = 1 + (int)(100 * Math.random()).
7. Each time you generate the random number, add it to the aBag object.