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

What college course would I need to take to be a part of recreation in a long-term care facility?
Lynette has a metal door stop with the dimension 12cm 6cm 3.5cm each cubic centimeter of the metal in the doorstop has a mads of aboyt 8.6 find the volume of th
list the 3 levels of federal courts
-3x - 3y = -30 -2x + 7y = -2 (This is elimination)
Please help!!!!!!!!!!!!!!!!
Suzie and richard are cohabitating, while becky and bernard are married. it is likely that:
In a school there are two sections - section A and section B or class X . There are 32 students in section A and 36 students in section B . Determine the mini
I need help and i need to explain how I got it
Please help and show work!! EVENS ONLY!! I'm really stuck!! Will mark brainliest!!
The Supreme Court chooses to hear cases that __________. A. affect only small groups of people B. are important to the president, since he/she appoints the jus