Assignemnt #62

Code

/// Name: Ryan Volko
/// Period: 7
/// Program Name: Dice2
/// File Name: Dice2.java
/// Date Finished: 12/8/2015

import java.util.Random;
import java.util.Scanner;

public class Dice2
{
	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;
        z = x + y;
		String response = "";
        
        System.out.println("Here comes the dice!");
        
        while ( x != y )
        {
        x = 1 + r.nextInt(6);
        y = 1 + r.nextInt(6);
        
        z = x + y;
        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 +"!");
        System.out.println("");
        }
        
        }
        }
    

Picture of the output

Assignment 62