Assignemnt #57 and Dice Rolls
Code
///Name: Daniel Tiffany-Appleton
///Period: 7
///Program Name: Dice Rolls
///File Name: DiceRolls
///Date Finished: 11/13/15
import java.util.Random;
public class DiceRolls
{
public static void main( String[] args )
{
Random r = new Random();
int rollOne = 1 + r.nextInt(6);
int rollTwo = 1 + r.nextInt(6);
int total = rollOne + rollTwo;
System.out.println( "HERE COMES THE DICE!" );
System.out.println( "" );
System.out.println( "Roll #1: " + rollOne );
System.out.println( "Roll #2: " + rollTwo );
System.out.println( "The total is " + total + "!" );
}
}
Picture of the output