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

Doing monomials. How do you do this one?
$10 + ($6-n) if n =$3 What is the final product Of this mathematical question?
how to undo the operation and explain why it works a. adding 28 b. dividing by 17
If (-3, y) lies on the graph of y = (1/2)x, then y =
How can you find the net force if two forces act in opposite direction?
If (-3, y) lies on the graph of y = (1/2)x, then y =
How did Islam and the beliefs of indigenous societies fuse among African people?
What is 47% of 164 while using a fraction to estimate the percent of each number.
how did other nations contribute to the american revolution?
What is the initials for sodium chloride