Assignemnt #62
Code
/// Name: Daniel Nguyen
/// Period: 6
/// Program Name: DoubleDice Program
/// File Name: DoubleDice.java
/// Date Finished: 9/9/2015
import java.util.Scanner;
import java.util.Random;
public class DoubleDice
{
public static void main( String[] args )
{
Scanner keyboard = new Scanner(System.in);
Random r = new Random();
int rng, gnr;
rng = 1;
gnr = 2;
System.out.println("Here comes the DICE!");
while (gnr != rng) {
rng = 1 + r.nextInt(6);
gnr = 1 + r.nextInt(6);
System.out.println("");
System.out.println("Roll #1: " + rng);
System.out.println("Roll #2: " + gnr);
}
}
}
Picture of the output