Assignemnt #71 and Shorter Double
Code
///Name: Daniel Rhees
///Period: 5
///Project Name: Shorter Double
///File Name: ShorterDouble.java
///Date: 1/15/2016
import java.util.Random;
public class ShorterDouble
{
public static void main( String[] args)
{
System.out.println("They commin in hot!");
Random r = new Random();
int r1 = 1 + r.nextInt(5);
int r2 = 1 + r.nextInt(5);
do
{
r1 = 1 + r.nextInt(5);
r2 = 1 + r.nextInt(5);
System.out.println("\tRoll #1: " + r1 );
System.out.println("\tRoll #2: " + r2 );
int total = r1 + r2;
System.out.println("The total is " + total + "!" );
}while ( r1 != r2 );
}
}
Picture of the output