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

If 1 bus = 12 cars, 3 cars = 1 truck, and 1000 basketballs = 1 truck, how many basketballs can be carried by 8 buses?
Explain why graphs show the first quadrant but omit the other three quadrants.
a timber fence is to be built on sloping land, with the shortest piece of timber 1.2m and the longest 1.8m. there are 61 pieces of timber in the fence.   b) wha
how do you get 1/8 of 16048
I need help in solving this
what are the four "human skills" that a good Administrative Medical Assistant should possess. Give a realistic medical office example of how the MAA could us
Find the vertex F(x)=5x²-10x+3
Which of the following is TRUE about Supreme Court justices? A. They are the country’s foremost authorities on state constitutions. B. Justices throw cases away
which of these items is not needed to make a working circuit? a. connecting wire b. a switch c. a component such as a bulb d. a cell
The politicians who met at the Hartford Convention in 1814