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

please help!!!!! Which defines the piecewise function shown?
When an alpha particle is emitted from an unstable nucleus, the atomic mass numberof the nucleus 9) _______ A) increases by 4. B) decreases by 2. C) increa
What is pitch related to in terms of sound? Does it affect the speed? If so, how?
Which feature is characteristic of rivers?
Complete the table. x 1 ___ 7
Which letter could represent sin -135°? A. a B. b C. c D. d
What happens to a reaction at equilibrium when more reactant is added to the system?
A carpenter has driven four stakes into a level building lot for the corners of a rectangular building as shown in the figure. When she measures the diagon
What did analysist attribute to Kennedy winning the 1960 election?
A person's flexibility does not depend on which of the following? A. Age B. Height C. Gender D. Genetics