Assignment # 71 and Shorter Double Dice

Code

    /// Name: Tommy Oyuntseren
    /// Period: 7
    /// Program Name: ShorterDoubleDice
    /// File Name: ShorterDoubleDice.java
    /// Date: 1/14/2016

import java.util.Random;

public class ShorterDoubleDice
{
    public static void main(String[] args)
    {
        System.out.println("HERE COMES THE DICE!");
        
        System.out.println();
        
        Random r = new Random();
        int x, y;
        
        do
        {
             x = 1 + r.nextInt(6);
             y = 1 + r.nextInt(6);
            
            System.out.println("\nRoll #1: " +x);
            System.out.println("Roll #2: " +y);
        
            System.out.println("The total is " + (x+y) + "!");
        } while (x != y);
    }
}
   

  

Picture of the output

Assignment 71