Introduction: Java Code/Program - Random Number Generator, While, If/Else Loops, or Operator

About: Occupation: tech support

Java code/program that does the following:

  1. Asks the user to enter a number between 1 and 10.
  2. Checks to make sure that the number entered was between 1 and 10.
  3. If it is not between 1 and 10, it asks the user to enter it again.
  4. Then the program generates a number between 1 and 10 using the Java Random class.
  5. Program compares the number that was generated to the number that was entered by the user.
  6. If the number generated by the program does not match the one entered by the user, the program generates another number and then runs the comparison again.
  7. Once the number generated by the program is equivalent to the number that was entered by the user, the program informs the user that there is a match and the program terminates.