Assignemnt #57 Dice
Code
/// Name: Jake Johnson
/// Period: 7
/// Program Name: Dice
/// File Name: Dice.java
/// Date Finished: //2015
import java.util.Random;
public class Dice
{
public static void main (String [] args)
{
Random r = new Random();
int die1 = 1 + r.nextInt(6);
int die2 = 1 + r.nextInt(6);
int total = die1 + die2;
System.out.println("HERE COMES THE DICE!");
System.out.println("");
System.out.println("Roll #1: " + die1 + "!");
System.out.println("Roll #2: " + die2 + "!");
System.out.println("The total is " + total + "!");
}
}
Picture of the output