All pastes #274842 Raw Edit

Someone

public java v1 · immutable
·published 2006-12-11 00:18 UTC
rendered paste body
    /**     * 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;    }