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 05:30
The total revenues for a company are $150,223 and the total expenses were 125,766. if you are calculating the net income, which of these spreadsheets would you use? insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2-b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2+b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2/b3. the formula should be showing in the formula bar. insert a spreadsheet with $150,223 in cell b2 and 125, 766 in cell b3. enter a formula =b2*b3. the formula should be showing in the formula bar.
Answers: 3
question
Computers and Technology, 22.06.2019 20:50
What is the difference between windows 7 and windows 10?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Match the sentence fragment in the first column with the appropriate ending in the second column. a little per favore?
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Fall protection, confined space entry procedures, controlled noise levels, and protection from chemical hazards are some of the things that contribute to a safe what
Answers: 1
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, 10.12.2020 01:00
question
Biology, 10.12.2020 01:00
question
Mathematics, 10.12.2020 01:00
Questions on the website: 13722361