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

Which one of the following snacks provides all of the essential amino acids
Find the equivalent function to f(x) = 3(6)^2x
which of the following practices was most likely to occur before the Enlightenment but not after
What is the slope of a line that is perpendicular to the line x=-3? A(-3 B(0 C(1/3 D(underfined
A radio telescope has a parabolic surface, as shown below. If the telescope is 1 m deep and 12 m wide, how far is the focus from the vertex? (5 points)
Which of the following decreases the chances of an alcohol overdose
Which is the best synonym for alienation?
—anunciaron una venta grande en el almacén hoy. —¡qué bien! necesito ropa pero no puedo _____ mucho.
What limited the early presidents
This drug class __________ results in increased heart rate, blood pressure, and elevated mental function.