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

Which word below means "to make as small as possible"? O A. Loss O B. Minimize O C. Revenue O D. Maximize
they would go to the ___ of the earth to find their dog if they lost him. a) ends’ b) ends c) end’s
This man is jumping through the air what are forces use​
how would you say “i like creating watercolor paintings” in japanese (specifically romaji)
PLEASE HELP ASAP 21.Conjugate in the Future Tense: Lola (preparar) 22. Conjugate in the Future Tense: Nosotros (*hacer) 23. Conjugate in the Future Tense: Mario
How did the French Revolution inspire events elsewhere in Europe?
what is the difference between high and low pressure?A. there are the same number of particle collisions happening in high and low pressure B. in low pressure,
A. la palanca de cambio B. el maletero C. el volante D. el asiento
What should a reader consider when looking for a theme?
Read this excerpt from "On Virtue," by Phyllis Wheatley. O thou bright jewel in my aim I strive To comprehend thee. Thine own words declare Wisdom is higher tha