Assignment #55

Code

    /// Name: Ian Stanko
    /// Period: 5
    /// Program Name: RandomNumberGame
    /// File Name: RandomNumberGame.java
    /// Date Finished: 11/19/2015
    
  import java.util.Random;
  import java.util.Scanner;
    
    public class RandomNumberGame
    {
        public static void main(String[] args)
        {
            Scanner keyboard = new Scanner(System.in);
            
            Random r = new Random();
            int choice = 1 + r.nextInt(10), s;
		    String response = "";
            
            System.out.println("LE WURST GAM EVR");
            System.out.println("");
            System.out.print("iM TINKIN' UF A NUMBA BTWEN 1-10. GES ITT. ");
            s = keyboard.nextInt();
            System.out.println("");
            
            if (choice == s)
            {
                System.out.println("GUD JOBB!");
            }
            
            else
            {
                System.out.println("U SUK! MY NUMBA WAZ " + choice );
            }
        }
    }    

    

Picture of the output

Assignment 55