Class Die java.lang.Object extended by Die public class Die extends java.lang.Object Die - an n-sided die with given integer values. The given integer values are returned via nextRoll() with uniform probability., Constructor Summary Die() Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6. Die(int[] outcomes) Creates a new Die instance with the given integer outcomes. Die(int sides, int min) Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Method Summary int nextRoll() nextRoll - return one of the die values at random. Methods inherited from class java.lang.Object clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait Constructor Detail Die public Die(int[] outcomes) Creates a new Die instance with the given integer outcomes. Parameters: outcomes - an int[] value - an array of the integer values for each side of the die. Die public Die(int sides, int min) Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Thus, the die is numbered min, min + 1, ... min + sides - 1. Parameters: sides - an int value - number of sides on the die min - an int value - minimum value of the incremental sequence of die values Die public Die() Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6. Method Detail nextRoll public int nextRoll() nextRoll - return one of the die values at random. Each value is equiprobable. Returns: an int value - die value rolled

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter9: Using Classes And Objects
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

Class Die

java.lang.Object
extended by Die
public class Die
extends java.lang.Object
Die - an n-sided die with given integer values. The given integer values are returned via nextRoll() with uniform probability.,

Constructor Summary
Die()
Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6.
Die(int[] outcomes)
Creates a new Die instance with the given integer outcomes.
Die(int sides, int min)
Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value.

Method Summary
int nextRoll()
nextRoll - return one of the die values at random.

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail
Die

public Die(int[] outcomes)
Creates a new Die instance with the given integer outcomes.
Parameters:
outcomes - an int[] value - an array of the integer values for each side of the die.
Die

public Die(int sides,
int min)
Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Thus, the die is numbered min, min + 1, ... min + sides - 1.
Parameters:
sides - an int value - number of sides on the die
min - an int value - minimum value of the incremental sequence of die values
Die

public Die()
Creates a new Die instance with the default values: 1, 2, 3, 4, 5, 6.
Method Detail
nextRoll

public int nextRoll()
nextRoll - return one of the die values at random. Each value is equiprobable.
Returns:
an int value - die value rolled

Package Class Tree Deprecated Index Hellp
PREV CLASS NEXT CLASS
SUMMARY: NESTED | FIELDI CONSTRI METHOD
FRAMES NO FRAMES
DETAIL: FIELD |CONSTRIMETHOD
Class Die
java.lang.Object
LDie
public class Die
extends java. lang.object
Die - an n-sided die with given integer values. The given integer values are returmed via nextRoll (1 with uniform probability.,
Constructor Summary
Die()
Creates a new Die instance with the default values: 1,2, 3, 4,5,6.
Die(int[] outcomes)
Creates a new Die instance with the given integer outoomes.
Die(int aides, int min)
Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value.
Method Summary
int nextRoll()
nextRol1- return one of the die values at random
Methods inherited from class java.lang.Object
clone, equals, finalize, getclass, hashCode, notify, notifyAll, tostring,, wait, wait, wait
Constructor Detail
Die
public Die (int[] outeomes)
Creates a new Die instance with the given integer outcomes.
Parameters:
outcomes an int[] value - an array of the inte ger values for cach side of the dic.
Die
public Die (int sides,
int min)
Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Thus, the die is numbered min, min + 1,
.min + sides - 1
ParameterN:
sides - an int value - number of sides on the die
min - an int value - minimum value of the incremental sequence of die values
Die
public Die ()
Creates a new Die instance with the default values: 1, 2, 3,4,5,6.
Method Detail
next Roll
public int nextRoll()
nextRoll- return one of the die walues at randorm. Each value is equiprobable.
Returns:
an int value - die value rolled
Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS
SUMMARY: NESTED | FIELDI CONSTRI METHOD
FRAMES NO FRAMES
DETAIL: FIELD | CONSTR I METHOD
Paint X lite
Transcribed Image Text:Package Class Tree Deprecated Index Hellp PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELDI CONSTRI METHOD FRAMES NO FRAMES DETAIL: FIELD |CONSTRIMETHOD Class Die java.lang.Object LDie public class Die extends java. lang.object Die - an n-sided die with given integer values. The given integer values are returmed via nextRoll (1 with uniform probability., Constructor Summary Die() Creates a new Die instance with the default values: 1,2, 3, 4,5,6. Die(int[] outcomes) Creates a new Die instance with the given integer outoomes. Die(int aides, int min) Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Method Summary int nextRoll() nextRol1- return one of the die values at random Methods inherited from class java.lang.Object clone, equals, finalize, getclass, hashCode, notify, notifyAll, tostring,, wait, wait, wait Constructor Detail Die public Die (int[] outeomes) Creates a new Die instance with the given integer outcomes. Parameters: outcomes an int[] value - an array of the inte ger values for cach side of the dic. Die public Die (int sides, int min) Creates a new Die with a given number of sides and an incremental sequence of values beginning with a given minimum value. Thus, the die is numbered min, min + 1, .min + sides - 1 ParameterN: sides - an int value - number of sides on the die min - an int value - minimum value of the incremental sequence of die values Die public Die () Creates a new Die instance with the default values: 1, 2, 3,4,5,6. Method Detail next Roll public int nextRoll() nextRoll- return one of the die walues at randorm. Each value is equiprobable. Returns: an int value - die value rolled Package Class Tree Deprecated Index Help PREV CLASS NEXT CLASS SUMMARY: NESTED | FIELDI CONSTRI METHOD FRAMES NO FRAMES DETAIL: FIELD | CONSTR I METHOD Paint X lite
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Development strategies
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,