Assignemnt #57 and Dice
Code
/// Name: Kyle Ivy
/// Period: 5
/// Program Name: Dice
/// File Name: Dice.java
/// Date Finished: 12/2/2015
import java.util.Random;
import java.util.Scanner;
public class Dice {
public static void main ( String[] args ) {
Random r = new Random();
Scanner keyboard = new Scanner(System.in);
int n1 = 1 + r.nextInt(6);
int n2 = 1 + r.nextInt(6);
System.out.println( "HERE COMES THE DICE! ");
System.out.println();
System.out.println( " Roll #1: " + n1 );
System.out.println( " Roll #2: " + n2 );
System.out.println( "The total is " + (n1 + n2) + "!" );
}
}
prog57.PNG