subject

A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the other is called "tails". The program below simulates randomly flipping that coin many times. var heads = 0;
var tails = 0;
var rolls = 100;
for(var i = 0; i < rolls; i++){
if(randomNumber(0,1) == 0){
heads++
} else {
tails++
}
}
Which of the following is NOT a possible combination of values of the variables in this program when it finishes running?

A. tails has a value of 0 and heads has a value of 100
B. tails has a value of 100 and heads has a value of 0
C. tails has a value of 20 and heads has a value of 20
D. tails has a value of 50 and heads has a value of 50

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:40
Consider the simple 3-station assembly line illustrated below, where the 2 machines at station 1 are parallel, i.e., the product only needs to go through one of the 2 machines before proceeding to station 2.what is the throughput time of this process?
Answers: 2
question
Computers and Technology, 23.06.2019 04:00
In a word processing program, such as microsoft word, which feature to you choose the desired picture enhancement?
Answers: 2
question
Computers and Technology, 24.06.2019 05:30
If you combine two cells into one, what action are you performing? a.  adding a new row or column      b.  splitting the cells      c.  removing a new row or column      d.  merging the cells
Answers: 2
question
Computers and Technology, 25.06.2019 06:20
If you want to change the speed of a layer's horizontal scrolling, what should you change? a. the x coefficient b. the y coefficient c. the virtual width d. the order of the game's layers select the best answer from the choices provided
Answers: 2
You know the right answer?
A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and the o...
Questions
question
Mathematics, 02.03.2021 07:20
question
Mathematics, 02.03.2021 07:20
question
Mathematics, 02.03.2021 07:20
question
Mathematics, 02.03.2021 07:20
question
Mathematics, 02.03.2021 07:20
question
Mathematics, 02.03.2021 07:20
Questions on the website: 13722360