// ********************************************************
// Name:         Mohamed Aboutabl
// Date:         9/21/2004
// Assignment:   Lab 9 Dice.java
//
// *************************************************************
// References & Acknowledgements: I received no outside help
//
// ********************************************************
// Dice.java
// Demonstrate the use of Random numbers
//
// ********************************************************

// import statement goes here

import java.util.Random ;


public class Dice
{
    // ---------------------------------------------------
    // Generate random numbers using the Random and 
	 // the Math classes
    // --------------------------------------------------

    public static void main (String[] args)
    {
	 	Random rand ;				// a Random object
		int die1 , die2, sumR	;	// Outcomes of the two dice using Random class
		int die3 , die4, sumM	;	// Outcomes of the two dice using Random class
		
		// Generating the outcomes of the two dice using Random class
		rand = new Random() ;
		
		die1 = 1 + rand.nextInt(6) ;
		die2 = 1 + rand.nextInt(6) ;
		sumR  = die1 + die2 ;

		System.out.println("**** Random class ****") ;
		System.out.println("Die1 = " + die1 + "\t\tDie2 = " + die2 + "\t\tSum = " + sumR) ;
		
		// Generating the outcomes of the two dice using Math class
		die3 = (int)  ( 1 + 6 * Math.random() ) ;
		die4 = (int)  ( 1 + 6 * Math.random() ) ;
		sumM = die3 + die4 ;

		System.out.println("**** Math.random  ****") ;
		System.out.println("Die1 = " + die3 + "\t\tDie2 = " + die4 + "\t\tSum = " + sumM) ;

		
	 }
}

