Assignemnt #62 Dice Doubles

Code

    Name: Iaroslav Titov
    Period: 7
    Project Name: DiceDoubles
    File Name: DiceDoubles.java
    Date: 11/10/2015
    
import java.util.Scanner;
import java.util.InputMismatchException;
import java.util.Random;

public class DiceDoubles
{
	public static void main(String[] args)
	{
		Random r = new Random();

		byte roll1 = 0;
		byte roll2 = 0;
		do {
			roll1 = (byte) (1 + r.nextInt(6));
			roll2 = (byte) (1 + r.nextInt(6));

			System.out.println();
			System.out.println("Roll the dice!!!");
			System.out.println();
			System.out.println("Roll#1 " + roll1);
			System.out.println();
			System.out.println("Roll#2 " + roll2);
			System.out.println();
			System.out.println("Total is " + (roll2 + roll1));
			System.out.println();
		}
		while (roll1!=roll2);
	}
}
    

Picture of the output

Assignment 59