Assignemnt #58 DoubleDice

Code

///Name: JJ Deng
///Period: 6
///Program Name: Double Dice
///File Name: DoubleDice.java
///Date Finished: 12/14/15

import java.util.Random;
    
public class DoubleDice
{
    public static void main(String[] args)
    {
            
        Random r = new Random();
            
        int d1, d2;
        double total;
            
        d1 = 1 + r.nextInt(6);
        d2 = 1 + r.nextInt(6);
        total = d1 + d2;
        
        while ( d1 != d2)
        {
            d1 = 1 + r.nextInt(6);
            d2 = 1 + r.nextInt(6);
            total= d1 + d2;
            System.out.println( "Roll your dice" );
            System.out.println( "" );
            System.out.println( "Roll 1: " + d1 );
            System.out.println( "Roll 2: " + d2 );
            System.out.println( "Total: " + total );
        }
     }
}
  

Picture of the output

Assignment 58