Assignment #71

Code

    /// Name: Ian Stanko
    /// Period: 5
    /// Program Name: ShorterDoubleDice
    /// File Name: ShorterDoubleDice.java
    /// Date Finished: 1/12/2016
    
    import java.util.Random;
    
    public class ShorterDoubleDice
    {
        public static void main(String[] args)
        {
            Random r = new Random();
            
            int roll1, roll2;
            double total;
            
            System.out.println("HERE THEY COME! (THE DICE)");
            
            do
            {
                roll1 = 1 + r.nextInt(6);
                roll2 = 1 + r.nextInt(6);
                total = roll1 + roll2;
                
                System.out.println("Roll #1: " + roll1 );
                System.out.println("Roll #2: " + roll2 );
                System.out.println("The total is " + total );
                System.out.println("");
            } while (roll1 != roll2);
        }
    }

    

Picture of the output

Assignment 71