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 is the purpose of an election carrier
Area of a rectangle is 540 sq m. If the length was reduced by 5m and the width was increased by 5m, the are of the rectangle will be increased 35 sq m. Calculat
What is a major difference between the personalities of cash and abuse according to the way Faulkner writes about each character?
What is the solution of 1/2 x= 5/6
To what extent did Napoleon’s reign reflect Enlightenment ideals?
guys please solve it
Two planes are driving toward each other with the speeds 250 mph and 420 mph respectively. If the distance between them are 1250 miles, in how many hours they w
The green line below
if you set x+5 = 0 the term inside the cube then solve for x
.7 Define the rule of law. Do you think the rule of law prevails in India?