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

The first step in a star formation is ______?
What is the hybridization state on the central N atom in the azide ion, N3−?
Please help ASAP only if you know
is this relation a function choose correct answer marking brainlist
The 5 paragraph format includes an introduction, supporting evidence and a summary. Please select the best answer from the choices provided T F (ima answer it i
Which of the following statements best describes exocytosis ? *19​
Is legalism in china today?
Which event happens first? Read the paragraph. "Where'd you find this pot roast, Ms. H.? In the gutter?!" Dead silence. Amanda stared at me with her mouth open.
Put the steps of seafloor spreading in order from the beginning (#1) to the end (#4) _____ Magma cools and hardens to form new crust. _____ Magma is forced up t
Is anybody willing to help me out? I’m not really into this and I’m just confused.