Assignment #51
Code
/// Name: Sam Wilson
/// Period: 6
/// Program Name: dice
/// File Name: dice.java
/// Date Finished: 12/1/2015
import java.util.Random;
public class dice
{
public static void main(String[] args)
{
Random r = new Random();
int r1, r2, total;
r1 = 1 + r.nextInt(6);
r2 = 1 + r.nextInt(6);
total = r1 + r2;
System.out.println( "Preparing to Roll two die" );
System.out.println( "" );
System.out.println( "Roll 1: " + r1 );
System.out.println( "Roll 2: " + r2 );
System.out.println( "Total : " + total );
}
}
Picture of the output