Computers and Technology

13. 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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 03:00, TamB01
How can i clip a picture to a question on the computer?
Answers: 1
image
Computers and Technology, 22.06.2019 07:00, ayoismeisalex
Our primary purpouse as electricians is to do wich of the following core concepts? a: install electrical components in a way they can be upgraded b: install electrical equiptment in a way that reduces heat c: install electrical systems in a safe manner d: only b and c
Answers: 1
image
Computers and Technology, 22.06.2019 16:30, jngonzo1226
Which of the following statements best describes it careers?
Answers: 2
image
Computers and Technology, 23.06.2019 01:30, giannav57
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
Do you know the correct answer?
13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and...

Questions in other subjects:

Konu
Geography, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Geography, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01
Konu
Mathematics, 13.09.2020 01:01