Assignemnt #62 DiceDoubles
Code
/// Name: Jake Johnson
/// Period: 7
/// Program Name: DiceDoubles
/// File Name: DiceDoubles.java
/// Date Finished: 12/7/2015
import java.util.Random;
public class DiceDoubles
{
public static void main (String [] args)
{
Random r = new Random();
System.out.println("HERE COMES THE DICE! \n");
int die1 = 1 + r.nextInt(6);
int die2 = 1 + r.nextInt(6);
int total = die1 + die2;
while (die1 != die2)
{
System.out.println("Roll #1: " + die1 + "!");
System.out.println("Roll #2: " + die2 + "!");
System.out.println("The total is " + total + "! \n");
die1 = 1 + r.nextInt(6);
die2 = 1 + r.nextInt(6);
}
System.out.println("Roll #1: " + die1 + "!");
System.out.println("Roll #2: " + die2 + "!");
System.out.println("The total is " + total + "!");
}
}
Picture of the output