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

Compute the variances in dollar amount and in percentage. (round to the nearest whole percent.) indicate whether the variance is favorable (f) or unfavorable (u
a bank quotes an annual rate on a certificate of deposit of 6%. if the effective annual rate is 6.180%, the frequency of compounding is closest to:
purely domestic firms will be at a disadvantage to mnes in the event of market disequilibria because
Many wild theories were put forward. it was thought that the plaques must have come from ancient egypt, or perhaps that the people of benin were one of the lost
if your client stops exhibiting the target behavior for a while after receiving reinforcement, what should you consider doing?
what was the relationship of American Indians to Europeans and to the colonists during the revolutionary era?
which enzyme makes? a. dna polymerase b. rna polymerase c. primase d. aminoacyl t-rna synthetase
what is the quotient (3x² + 8x − 3) ÷ (x + 3)? a. 3x + 5, r = 1 b. 3x - 5 c. 3x + 1 3x - 1
graph the equation y=-2/3x+5​
why is it illegal for a person living in winston salem, north carolina to be burried west of the missisipi