Assignment #52

Code

    /// Name: Jonathan Stine
    /// Period: 5
    /// Program Name: The Worst Number-Guessing Game Ever!
    /// File Name: NumberGuessing.java
    /// Date Finished: 1/19/16
    
    import java.util.Scanner;

    public class NumberGuessing
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            int secretNumber = 1;
            int guess;
            
            System.out.println("We're going to play a game now!");
            System.out.println();
            
            System.out.println("Try to guess a number between 1 and 10. I dare you! ");
            guess = keyboard.nextInt();
            
            System.out.println();
            
            if (guess == secretNumber)
                System.out.println("Woah! You rock, it is " + secretNumber + "!");
            else
                System.out.println("You suck. I was thinking of " + secretNumber + "!");
        }
    }
    
 
    

Code Output