Assignment #71 and Shorter Double Dice
Code
///John Mulligan
///period 5
///Program Name: ShorterDouble
///File Name: ShorterDouble.java
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 );
}
}