Die.java - import java.util.Random public class...

This preview shows page 1 out of 1 page.

import java.util.Random; public class Die //Simulates a six-sided die { private final int MIN_SIDES = 4; private int sides; //Number of sides private int value; //The die's value public Die(int numSides) //Constructor performs initial roll of die { //Validate the number of sides. if (numSides < MIN_SIDES) { throw new IllegalArgumentException( "The die must have at least " +

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture