I'm trying to validate the user input such that the program will loop back to the first question of asking the user for the grade if it is NOT an int and the int is not within the ranges of 9 - 12, inclusive. Is there a "better" way of writing this code?

```
do
    {
        if (userGrade < 9 || userGrade > 12)
        {
            System.out.println("That is not a valid grade!");
        }

            System.out.printf("Grade (9-12): ");

        while(!enterInfo.hasNextInt())
        {
            System.out.println("That is not a number! Enter in a valid number.");
            enterInfo.next();
        }
        userGrade = enterInfo.nextInt();
    } while (userGrade < 9 || userGrade > 12);

```