Assignemnt #72

Code

/// Name: Connor Siri
/// Period: 7
/// Program Name: Dice
/// File Name: Dice.java
/// Date Finished: 11/09/2015

import java.util.Random;

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


    

Picture of the output

Assignment12.html