Assignemnt #62 and Dice Doubles
Code
///Name: Ben Borglin
///Period: 6
///Program name: Dice Doubles
///file name: DiceDoubles.java
///Date Finsihed: 10/20/15
import java.util.Random;
public class DiceDoubles
{
public static void main( String[] args )
{
int total;
Random r = new Random();
int Roll1 = 1 + r.nextInt(6);
int Roll2 = 1 + r.nextInt(6);
System.out.println("HERE COMES THE DICE!");
System.out.print("");
while (Roll1 != Roll2)
{
System.out.println("Role #1: " + Roll1);
System.out.println("Role #2: " + Roll2);
total = Roll1 + Roll2;
System.out.println(" ");
System.out.println("The total is " + total);
Roll1 = 1 + r.nextInt(6);
Roll2 = 1 + r.nextInt(6);
}
}
}
Picture of the output