/** An instance of this class represents a die (such as is used in board ** games (e.g., Monopoly) and other games of chance (e.g., craps). ** The die need not be six-sided nor fair, however. Indeed, the client ** chooses (at construction) the number N>0 of sides (which correspond ** to toss outcomes 1, 2, ..., N) and the probability with which each ** toss outcome is to occur. */ public class NSidedDie { /**** instance variables ****/ /**** constructors ****/ /** Initializes the die so that it behaves as a fair, six-sided die. */ public NSidedDie() { } // STUB!! /** Initializes the die so that it behaves as a fair die having ** the specified number of sides. (If the specified number is ** not positive, an IllegalArgumentException is thrown.) */ public NSidedDie(int numSides) { } // STUB!! /** Initializes the die so that it behaves as one having N sides, ** where N is the length of the specified array, and where the ** relative likelihoods of its toss outcomes are specified by the ** values in the array elements. ** For example, if the array contains (2.0, 1.0, 5.0), the ** constructed die will have three sides (corresponding to toss ** outcomes 1, 2, and 3) with probabilities of, respectively, ** 2/8, 1/8, and 5/8 (note that 8 is the sum of 2.0, 1.0, and 5.0). ** ** (If the array length is zero or any of its elements has a ** negative value, an IllegalArgumentException is thrown.) */ public NSidedDie(double[] relProb) { } // STUB!! /**** observers ****/ /** Returns the number of sides that the die has. */ public numSides() { return 0; } // STUB!! /** Returns the result of the most recent toss of the die. */ public int faceUp() { return 0; } // STUB!! /** Returns the # of past tosses that produced k as the outcome. ** If 0