Assignemnt #53 and Randomness

Code

/// Name: Tristan Chung
/// Period: 5
/// Program Name: Randomness 
/// File Name: Randomness.java
/// Date Finished: 11/13/2015

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 1 to 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.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." );
		}
        // 1. New range is now 0-4 inclusive 2. The new range makes the range 3-7 inclusive 3. No longer random. 4. The randomn number changed from number 3 but it stayed the same. When I changed the random seed to 5 the random number was always the same. 
	}
}
    

Picture of the output

Assignment 53