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

another one please help
What is the formula of volume ofba rhombic prism
The Americans with disabilities act requires that wheelchair ramps have a slope no greater than 1/12 what is the minimum horizontal length a 2 foot high ramp ca
If I arrange the numbers 4,5,6,7,8,9,10,11 and 12 in the squares so that the sums of all the rows,columns and diagonals are 24 what is the answer?(magic squares
what year did Ancient Rome rise and fall
What are some examples of the word rueful in a sentence?
The Declaration of Independence states that if government does not protect citizens' rights, citizens have the authority to
one car travels east for 360 m over a period of 15 seconds. a second car travels west for 120 m over a period of 5 seconds. what is true about their speeds? the
how do you do substitution
18/15 into a mixed number