// Dice Rolling
import java.util.Random;
public class DiceRolling
{
public static void main( String[] args)
{
Random randomNumbers = new Random(); // Generates random numbers
int[] array = new int[ 13 ]; // Declares the array
int dice1;
int dice2;
int total;
//Roll the die 36,000 times
for ( int roll = 1; roll <=36000; roll++ )
dice1 = 1 + randomNumbers.nextInt ( 6 );
dice2 = 1 + randomNumbers.nextInt ( 6 );
total = dice1+dice2;
++array[total];
System.out.printf( "%s%10s\n", "Face", "Frequency" );
// outputs array values
for ( int face = 1; face < array.length; face++ )
System.out.printf( "%4d%10d\n", face, array[ face ] );
} // end main
} // end class DiceRolling