yvnggang6706 yvnggang6706
  • 21-11-2017
  • Computers and Technology
contestada

"write a program to simulate the rolling of two six-sided dice. the program should work by generating two random numbers, each in the range of 1 to 6, to represent the two dice"

Respuesta :

vjagan vjagan
  • 21-11-2017
Python:

from random import randint
dice_1 = randint(1, 6)
dice_2 = randint(1, 6)

Java:

int dice1 = (int) (Math.random() * 7);
int dice2 = (int) (Math.random() * 7);
Answer Link

Otras preguntas

HELP MEEEEEEEEEE PWEEEEEEEEEEEEEEEEEZZZZZZZZZZZ
PLS HELP ILL GIVE 100 POINTS AND BRANLIEST (answer the questions in bold) Wow! You now know so much about Mexico! Your friend Jordan, however, knows nothing abo
Assertion: An object will continue moving uniformly on a plane frictionless surface till the resultant force acting on it is Not Zero. Reason: The bodies do not
think about a delicious and nutritious food like khichuri
A rectangular park 40 yards wide was redesigned, and a path 1 yard wide was built around it. How long was the park before if, after the path was built, its area
Can I please get help on this I don’t understand it :( BRAINIEST
Jose has 4 times as many baseball cards as his brother. Together they have 40 baseball cards. How many baseball cards does Jose's brother have?
QUESTION: 3 ÷ 0.05 EMERGENCY: Pls answer
who built the statue of unity?
What was the context clue that helped you figure out the meaning of resolve? A. A word meaning the opposite was used in the sentence. B. The writer restated