Assignemnt #71

Code

///colin hinton
///5th period
///Dice
///Dice.java
///11/12/2015

import java.util.Random;

class Dice
{
    public static void main (String [] args)
    {
        Random r = new Random();
        
        int x, y;
        do
        {
        
            System.out.println("HERE COMES THE DICE!");

             x = (1 + r.nextInt(6));  
             y = (1 + r.nextInt(6));

            System.out.println("Roll 1: " + x);
            System.out.println("Roll 2: " + y);
            System.out.println("The total is " + (x + y));

        } while ( x != y );
            

    }
}
    

Picture of the output

Assignment 1