Assignment #57

Code

///Name: Conner Wygaerts
///Period: 6
///Project Name: DiceGame
///File Name: DiceGame.java
///Date Finished: 12/1/15

    import java.util.Random;

    public class DiceGame
    {
        public static void main(String[] args)
        {
            Random r = new Random();
            
            int roll1 = 1 + r.nextInt(6);
            int roll2 = 1 + r.nextInt(6);
            
            System.out.println("Lets roll the dice!");
            System.out.println();
            
            System.out.println("Roll #1: " + roll1);
            System.out.println("Roll #2: " + roll2);
            
            int total = roll1 + roll2;
            
            System.out.println("The total is " + total + "!");
        }
    }

Picture of the output

YourInitials.html