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

The success of the English colonies is due to all of the following except _____.
Are lines of symmetry for any given polygon also diagonal?
Why did Chinese immigrants have more difficulty asserting their rights than immigrants from Europe?
According to horney, which of the three interpersonal styles is likely to lead to a successful relationship
One of the advantages of communicating through email rather than through letters and telephone calls is A. proper punctuation isn't necessary. B. f
Which of the following statements BEST descibes how interest groups are limited in how they may contribute to politcal campaigns? A. Interest groups are limited
How did the assassination of archduke franz ferdinand spark wwi?
Elaborate on the suitability of "cola" type drinks to polish chrome surfaces. A) The basic pH of cola allows for easy removing of oils. B) The phosphoric acid
Ann owns two acres of trees. Which factors of production would Ann’s situation fall under? (Select all that apply.) 1-entrepreneurship 2-labor 3-land
A bullet is fired at a speed of 2434 ft/s. what is this speed expressed in millimeters per minute?