Assignment #53 and Randomness

Code

    /// Name: Ali Kurland
    /// Period: 6
    /// Program Name: Randomness
    /// File Name: Randomness.java
    /// Date Finished: 10/6/2015
    
    ///1. Deleting the 1 + in front of the six lines printing numbers 1-5 prints numbers from 0-4.
    ///2. Putting 3 + in front of the six lines prints numbers from 3-7.
    ///3 & 4. Putting the number 12353 in the random seed makes num1 equivalent to num2 every time the program runs, but the random numbers are different when the seed is something else.
    import java.util.Random;
    
    public class Randomness
    {
    	public static void main ( String[] args )
    	{
    		Random r = new Random();
    
    		int x = 1 + r.nextInt(10);
    
    		System.out.println( "My random number is " + x );
    
    		System.out.println( "Here are some numbers from 3 to 7!" );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.print( 3 + r.nextInt(5) + " " );
    		System.out.println();
    
    		System.out.println( "Here are some numbers from 1 to 100!" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.print( 1 + r.nextInt(100) + "\t" );
    		System.out.println();
    
    		int num1 = 1 + r.nextInt(10);
    		int num2 = 1 + r.nextInt(10);
    
    		if ( num1 == num2 )
    		{
    			System.out.println( "The random numbers were the same! Weird." );
    		}
    		if ( num1 != num2 )
    		{
    			System.out.println( "The random numbers were different! Not too surprising, actually." );
    		}
    	}
    }
    

Picture of the output

Assignment 53