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

solve quadratic equation by completing the square x²+2x-15=0
A box of 10 markers weighs 105 grams the Empty Box weighs 15 grams how much does the 10 markers weigh.
Maximum or Minimum. Domain and range of y=x^2-4x+4
Calcium hydroxide reacts with a substance to produce calcium carbonatename the substance
Seven less than the product of twice a number is greater than 5 more the same number. Which integer satisfies this inequality?a.116b.348c.2205d.2553
Which of the following is not capable of reacting with molecular oxygen? A. SO₂ B. SO₃ C. NO D. N₂O E. P₄O₆
Why does Nick seem to disapprove of Gatsby's wealth and status in the book the great gatsby?
The area of a circle is 12.56 square miles. What is the circle's radius?Use 3.14 for
What is a synonmyn for coat
what is the answer for 6r^2-10r-24