Assingment #71: Short Doubles
Code
/// Name: Kiran O'Farrell
/// Program Name: Short Doubles
/// File Name: ShortDoubles.java
/// Date completed: 1/21/16
import java.util.Random;
public class ShortDoubles {
public static void main (String[] args) {
Random r = new Random();
int roll1;
int roll2;
do {
roll1 = 1 + r.nextInt(6);
roll2 = 1 + r.nextInt(6);
System.out.println("Here's the roll!");
System.out.println("Roll #1: " + roll1);
System.out.println("Roll #2: " + roll2);
System.out.println("The total is: " + (roll1 + roll2));
} while (roll1 != roll2);
}
}
Picture of the output