Savadt719 Savadt719
  • 21-10-2020
  • Computers and Technology
contestada

Assume a random number generator object named randGen exists. What are the possible values for randGen.nextInt(6)?
a. 0...5
b. 0...7
c. 1...6
d. 0...6

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 21-10-2020

Answer:

a. 0...5

Explanation:

Given

randGen.nextInt(6)

Required

Determine the range of values

Using randGen object,

The syntax to generate a random integer is randGen.nextInt(n)

Where the range is 0 to [tex]n - 1[/tex]

In this case;

n = 6

So, range is 0 to 6 - 1

Range: 0 to 5

Hence;

Option A answers the question

Answer Link

Otras preguntas

an earthquake was felt throughout circular area of 1,808.64 square miles. what was the tadius of the circular area?
Sam painted 3 pictures.ellie painted twice as many pictures as Sam how many pictures did they paint altogether
Which organelle produces sugars while releasing oxygen, and in which cell could it be found?
How do you say "you are cute" in Japanese
How many savannahs are there in the world
Monogamy is defined as __________. a. only having one sex partner at a time b. practicing extreme abstinence c. not using schedule IV drugs d. recognizing da
Because the British government had imposed taxes on colonists without representation, the drafters of the Articles of Confederation
The Mid-Atlantic Ocean Ridge is an example of a _____. convergent boundary subduction zone divergent boundary transform boundary
In which of the following physical states does a given substance have the highest entropy? A. solid B. gas C. liquid D. all of the above
Approximately how old is the Sun? A. 1.4 billion years B. 2.1 billion years C. 4.6 billion years D. 10.2 billion years