///Name: Ilana Levy ///Period: 5 ///Program Name: Randomness ///File Name: randomness.java ///Date Finished: 9/21/2015 import java.util.Random; public class randomness { public static void main ( String[] args ) { Random r = new Random(); ///nothing changes with the numbers because they are locked into number bounds. however, if I deleted the bounds, the random numbers generated would all be between 0 and 123-1 which is 122. 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(); ///I assume that deleting the 1 + makes the choice of random number go from 0-4 instead of 1-5 /// making the "1 +" into "3 +" makes the scale go from 3-7 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." ); } } }