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

explain why the population of bacteria in the water increases after the plants die​
Frances greatest trade product to the Americans was a,tobacco b,sugar cane c,fur or d,all of the above
how many total atoms are in v2o5
What kind(s) of eukaryotic cells have mitochondria?
what is the graphing point for y=-1/2x-2​
What is the role of a cell membrane in mitosis?
please help me what is the answer to this​
Who introduced the camel to africa and were did it come from ? PLEASE answer quick ​
Vous achetez une voiture au prix de 32 000 $. Vous avez lu qu'elle perdra 19% de sa valeur à chaque année. Vous voulez la vendre lorsque sa valeur sera de 7500
Is the center of the street safer then the sides of the street? Explain your answer. I need help it’s a reading question due 11:59 PM