Assignment #57

Code

    ///Name: Cody Swain
    ///Period: 6
    ///Project Name: Dice
    ///File Name: Dice.java
    ///Date: 11/13/15
    
    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 x1 = 1 + r.nextInt(6);
            int x2 = 1 + r.nextInt(6);
            
            
            System.out.println( "HERE COMES THE DICE! ");
            System.out.println();
            System.out.println( " Roll #1: " + x1 );
            System.out.println( " Roll #2: " + x2 );
            System.out.println( "The total is " + (x1 + x2) + "!" );
            
        }
    }

        
    

Picture of the output

Assignment 57