Assignemnt #71 Shorter Double Dice

Code

    ///Name: Morgan Kaplan
    ///Period: 5
    ///Project Name: Shorter Double Dice
    ///File Name: SDD.java

import java.util.Random;

public class SDD
{
	public static void main ( String[] args )
	{
		Random r = new Random();
        int x,z;
    
    do     
       {
    
    x = 1 + r.nextInt(6);
    z= 1 + r.nextInt(6); 
    System.out.println( " Roll # 1 = " + x + " ");
    System.out.println( " Roll # 2 = " + z + " ");
    System.out.println( " Your total is " + ( x + z ) + " ");  
       }    
            
    while (x!=z);
    }
}
    

Picture of Output

Assignment 71