Assignemnt #71 and Shorter Double Dice
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: ShorterDoubleDice
/// File Name: ShorterDoubleDice.java
/// Date Finished: 1/5/2016
import java.util.Random;
import java.util.Scanner;
public class ShorterDoubleDice {
public static void main ( String[] args ) {
Random r = new Random();
Scanner keyboard = new Scanner(System.in);
int n1, n2;
System.out.println( "HERE COMES THE DICE! ");
do
{
System.out.println();
n1 = 1 + r.nextInt(6);
n2 = 1 + r.nextInt(6);
System.out.println( " Roll #1: " + n1 );
System.out.println( " Roll #2: " + n2 );
System.out.println( "The total is " + (n1 + n2) + "!" );
} while ( n1 != n2 );
}
}
prog71.PNG