Assignemnt #71
Code
/// Name: Ryan Volko
/// Period: 7
/// Program Name: DiceDouble
/// File Name: DiceDouble.java
/// Date Finished: 12/8/2015
import java.util.Random;
public class DiceDouble
{
public static void main( String[] args )
{
Random r = new Random();
int x, y;
double z;
System.out.println("Here comes the roll");
do
{
x = 1 + r.nextInt(6);
y = 1 + r.nextInt(6);
z = x + y;
System.out.println("Roll #1: " + x);
System.out.println("Roll #2: " + y);
System.out.println("The Total is " + z);
System.out.println("");
} while ( x != y );
}
}
Picture of the output