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

who was willaim pitt
PLEASE EXPLAIN!!! Select the equation of the line that passes through the point (3, −1) and is parallel to the line on the graph. y = −1 y = 3 y = x −1 y =
Thomas Jefferson contributed to the development of the democratic ideals in the United States by:
How do I make a five act play out of the one act play Endgame?
The area of a gymnasium floor is 264 square yards. The floor is 11 yards wide. How long is the floor? A. 24 yards B. 11 yards C. 253 yards D
A newborn experiencing respiratory distress syndrome (rds) will demonstrate signs:
Which shows another way to write 63? A. 3 + 3 + 3 + 3 + 3 + 3 B. 3 × 3 × 3 × 3 × 3 × 3 C. 6 × 6 × 6 D. 6 + 6 + 6
Which career role is concerned with obtaining copyrights for songs or music scores
When faced with moral dilemmas involving killing one person to save five others, ____.​?
Propranolol is a beta blocker that affects hypertension. which division does it impact the most?