Assignemnt #62: Dice Doubles

Code

    /// Name: Kelsey Lieberman
    /// Period 5
    /// Program Name: DiceDoubles
    /// File Name: DiceDoubles.java
    /// Date Finished: 12/4/2015
    
import java.util.Random;

public class DiceDoubles
{
    public static void main(String[] args)
    {
        Random r = new Random ();
        
        int x = 1 + r.nextInt(6), z = 1 + r.nextInt(6);
        
        System.out.println("HERE COMES THE DICE...");
        System.out.println("AAAUUGGHHHHHHHHHHH");
        System.out.println();
        System.out.println("First roll: "+x);
        System.out.println("Second Roll: "+z);
        System.out.println("The total is " + (z+x) + "!");
        
        while (z != x)
        {
            x = 1 + r.nextInt(6);
            z = 1 + r.nextInt(6);
            System.out.println("First roll: "+x);
            System.out.println("Second Roll: "+z);
            System.out.println("The total is " + (z+x) + "!");
        }
    }
}
    

Picture of the output

Assignment 62