estradaangelic80
estradaangelic80 estradaangelic80
  • 12-11-2020
  • Computers and Technology
contestada

How many times is the coin tossed?

var heads = 0;
var tails = 0;
var rolls = 100;
for(var i = 0; i < rolls; i++){
if(randomNumber(0,1) == 0){
heads++
} else {
tails++
}
}

Respuesta :

ksuakh89 ksuakh89
  • 12-11-2020

Answer:

100 times.

Explanation:

The code will loop until i is equal to or greater than roles. I starts at zero and increases by one after each toss.

Answer Link
unicorn11908
unicorn11908 unicorn11908
  • 12-11-2020
The answer is what the other guy said
Answer Link

Otras preguntas

Which of the following statements is a MAD goal? a. I want to play professional football for my favorite team after I finish college. b. I want to reach a skee
In what ways did the cultural development of vietnam resemble that of korea
Simplify this expression: cos theta/ tan theta cot theta
How did Porfirio Díaz change the direction of government in Mexico?
What is the first step needed to solve 4 over 7 the whole multiplied by x minus 5 equal negative 13? Subtract 13 from both sides Divide both sides by 7 Add 5 to
A coin is flipped 70 times and lands on tails 28 times. What is the relative frequency of the coin landing on tails? 20% 30% 40% 50%
Which sentence uses punctuation correctly? a. My friend jumped off the diving board and shouted "look out below!" b. My friend jumped off the diving board and
I'm stuck, could someone help me? A frog is sitting on a stump 15 feet above the ground. It hops off the stump and lands on the ground 6 feet way. During its l
How do you sovle 2x+2y=18 6x+y=39
What happened when Spain’s government could not overcome social and economic problems during the Great Depression?