/** * Checks whether the guess is correct and prints whether the number * is smaller or greater than the guess. * * @param secret the computer's secret number. * @param guess the user's guess. * * @return true if the guess is correct, false otherwise. */ private static boolean isGuessCorrect( int guess, int secret ) { boolean retVal; // Value to return if ( guess == secret){ retVal = true; } else { retVal = false; } if( secret <= guess ) { System.out.println( "The number is less than " + guess ); } else { System.out.println( "The number is more than " + guess ); } return retVal; }