Assignemnt #52: The Worst Number-Guessing Game Ever

Code

    /// Name: Cassie
    /// Period: 6
    /// Program Name: The Worst Number-Guessing Game Ever
    /// File Name: numguess.java
    /// Date Finished: 12/1/2015
    
    import java.util.Scanner;
        
    class numguess {
    
        public static void main( String[] args) {
        
            Scanner keyboard = new Scanner(System.in);
            int number = 8, answer;
            
            System.out.println( "Guess a number between 1 and 10." );
            answer = keyboard.nextInt();
            
            if ( number == answer )
            {
                System.out.println( "I guess you win. Whatever." ); 
            }
            else 
            {
                System.out.println( "Hahaha. You're a failure.");
            }
        }
    }
    

Picture of the output

Assignment 52