subject

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

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 13:30
Jane’s team is using the v-shaped model for their project. during the high-level design phase of the project, testers perform integration testing. what is the purpose of an integration test plan in the v-model of development? a. checks if the team has gathered all the requirements b. checks how the product interacts with external systems c. checks the flow of data in internal modules d. checks how the product works from the client side
Answers: 1
question
Computers and Technology, 23.06.2019 02:00
Which of the following is not a source of sustainable raw materials? a) coal mine b) flick of sheep c) cotton plantation d) line forest.
Answers: 2
question
Computers and Technology, 23.06.2019 07:50
Apython programming question: assume s is a string of lower case characters. write a program that prints the number of times the string 'bob' occurs in s. for example, if s = 'azcbobobegghakl', then your program should print number of times bob occurs is: 2
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
How do i get rid of my member ship for
Answers: 2
You know the right answer?
13. A 2-sided coin has an equal likelihood of landing on each side. One side is called "heads" and...
Questions
question
Physics, 19.02.2020 21:31
Questions on the website: 13722362