Assignment 71
code
///Name: Mutsu Osoegawa
///Period: 7
///Project Name: Shorter Double Dice
///File Name: ShorterDiceDouble.java
///Date: 12/17/2015
import java.util.Random;
public class ShorterDiceDouble
{
public static void main( String[] args )
{
Random r = new Random();
int roll1, roll2;
roll1 = 1;
roll2 = 2;
System.out.println( "HERE COMES THE DICE!" );
System.out.println();
do
{
roll1 = 1 + r.nextInt(6);
roll2 = 1 + r.nextInt(6);
int total = roll1 + roll2;
System.out.println( "Roll #1: " + roll1 );
System.out.println( "Roll #2: " + roll2 );
System.out.println( "The total is " + total + "!" );
} while ( roll1 != roll2 );
}
}