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

help i am in need of help
Use Pascal's Triangle to find (9 3). Someone help me please I don't have whatever that is.
Amy and david just had an awesome date. they went to a great restaurant and then played shuffleboard at a new bar. they are feeling close and committed to their
A group of 7- to 10-year-old children are playing organized little league baseball. they have learned the formal rules of the game, and they play according to t
The Declaration of Independence included the people's right to life, liberty and what other privilege? Right to not pay taxes Right to hold government office Ri
Match each example of a sexual myth to the reality. A. Kim wears low-cut shirts, so she wants to be assaulted. Some victims are too afraid to say no in violen
in 2014 the birthrate in France was 12 (per 1000 people) in the same year the death rate in France was 8 (per 1000 people) what was Frances approximate growth r
Can someone help me please
Seth has two similar ice cream cones, cone A cone b the height of cone a is 16 inches in the height of cone B is 4 inches what is the ratio of the volume of co
Find the length and width of a rectangle whose perimeter is 40 feet and whose area is 96 square feet.