Answer:
Following is given the program code as required:
Step-by-step explanation:
- Initially a class is created name RandomGuessMatch.java
- An instance for scanner class is created in main method.
- Now the upper and lower bounds for guess are given by variables MIN (1) and MAX(5).
- Now user will be allowed to guess the number.
- The difference between the guessed number and actual number is calculated.
- This will tell the compiler weather to print correct or incorrect.
i hope it will help you!