Assignemnt #53 Dice

Code


//Name: JJ Deng
///Period: 6
///Program Name: Dic
///File Name: Dice.java
///Date Finished: 12/2/15 
    
import java.util.Random;
    
public class Dice
{
    public static void main(String[] args)
    {
            
        Random r = new Random();
            
        int d1, d2;
        double total;
            
        d1 = 1 + r.nextInt(6);
        d2 = 1 + r.nextInt(6);
        total = d1 + d2;
            
        System.out.println( "Roll ur freking dice" );
        System.out.println( "" );
        System.out.println( "Roll 1: " + d1 );
        System.out.println( "Roll 2: " + d2 );
        System.out.println( "Total: " + total );
            
     }
}
    
     

Picture of the output

Assignment 43