Assignemnt #62

Code

    ///Name: Joshua Bautista
    ///Period: 6
    ///Project Name: DiceDoubles
    ///File Name: DiceDoublew.java
    ///Date: 1/7/2016
    
    import java.util.Random;

public class DiceDoubles
{
    public static void main( String[] args )
    {
        Random r = new Random();
        
        int x = 1 + r.nextInt(6);
        int y = 1 + r.nextInt(6);
        int total = ( x + y );
        
        System.out.println();
        System.out.println(" Here comes the dice! ");
        System.out.println();
        while ( x != y )
        {
         x = 1 + r.nextInt(6);
         y = 1 + r.nextInt(6);
         total = ( x + y );
        System.out.println(" Roll #1: " + x );
        System.out.println(" Roll #2: " + y );
        System.out.println(" The total is " + total + " ! " );
        System.out.println();
       
        }
    }
}
    

Picture of the output

Assignment 1