Assignemnt #58

Code

/// Name: Connor Siri
/// Period: 7
/// Program Name: Dice
/// File Name: Dice.java
/// Date Finished: 10/28/2015

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 y = 1 + r.nextInt(6), x = 1 + r.nextInt(6), z;
    
		String response = "";
        
        System.out.println("Here comes the dice!");
        System.out.println("");
        System.out.println("Roll #1: " + x);
        System.out.println("Roll #2: " + y);
        z = x + y;
        System.out.println("The total is " + z +"!");
        
        
                           }
}
            
         
        
         
        
        
    

Picture of the output

Assignment5.html