Dice


import java.util.Random;
    
    public class dic
    {
        
        public static void main( String[] args ) 
        {
            
            Random r = new Random();
            
            int d1, d2, total;
            
            System.out.println( "Here comes the dice" );
            System.out.println();
            
            d1 = 1 + r.nextInt(6);
            d2 = 2 + r.nextInt(6);
            total = d1 + d2;
            
            System.out.println( "The first roll is " + d1 );
            System.out.println( "The second role is " + d2 );
            System.out.println( "Your total is " + total );
            
        }
    }
 
    

Picture of the output

Assignment 57