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

Why's it possible for many different species to live together in one ecosystem?
Can someone please explain how I would figure this out
Can someone please explain how I would figure this out
What factors distinguish one biome from another?
What does ¿Cuál es la fecha de hoy? mean and how would you answer?
What is the rubbing force that acts against motion between two touching surfaces .
WHAT IS A GOOD PERSONIFICATION POEM ABOUT THE FIRST DAY OF SCHOOL!!!!!
How much force is needed to accelerate a 68 kilogram-skier at a rate of 1.2 m/sec^2?
If the atmosphere is like a greenhouse, what parts of it function as the "glass"?
a rational number between 1.7 and 1.8