Solved

Which of the Following Is the Correct Code Snippet for Throwing

Question 97

Multiple Choice

Which of the following is the correct code snippet for throwing a pair of dice to get a sum of the numbers on two dice between 2 and 12 with different probabilities? (Assume Random generator = new Random() ;)


A) int sum = generator.nextInt(6) + generator.nextInt(6) + 2
B) int sum = generator.nextInt(12) + 1
C) int sum = generator.nextInt(6 + 1) + generator.nextInt(6 + 1)
D) int sum = generator.nextInt(11) + 2

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions