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