Assignment #55 and A Number Guessing Game

Code

    /// Name: Trent Lane
    /// Period: 6
    /// Program Name: A Number-Guessing Game
    /// Date Finished: 11/19/2015
    
    import java.util.Scanner;
    import java.util.Random;
    
    public class NumberGuessingTwo
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            Random r = new Random();
    
            int secretNumb = 1 + r.nextInt(10);
            int guessNumb;
    
            System.out.println("I'm thinking of a number from 1 to 10.");
    
            System.out.print("Your guess: ");
            guessNumb = keyboard.nextInt();
    
            System.out.println();
    
            if (guessNumb == secretNumb)
                System.out.println("That's right! My secret number was " + secretNumb + "!");
            else
                System.out.println("Sorry, but I was really thinking of " + secretNumb + ".");
        }
    }

 

Picture of the output

Assignment 55