Assignemnt #71
Code
/// Name: Holden Ganch
/// Period: 7
/// Program Name: seventy first Program
/// File Name: Dice.java
/// Date Finished: 1/11/2016
import java.util.Random;
public class Dice
{
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