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

who likes copehagen wintergreen long cut
A police car go goes flying past you on the highway with its sirens blaring. You notice as the police car gets closer, the pitch of the sirens changes. Once t
What is 11 22/15 Simplified to the simplest form?
What four factors influence the kind of clothing choices?
Mr. Chui was In muji City for a
What is the molarity of 4 moles of C6H12O6 dissolved in 16 L of solution?
I need help with these three please and thank you
During the peak of industrialization in America in the decades following the Civil War, which group of Americans did most of the low-paying, back-breaking facto
Write a real world problem that involves classifying a quadrilateral. Then solve the problem
what is 8/400 reduced