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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education