1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klio [65]
3 years ago
14

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the sim

ulation resulted in an equal number of heads and tails.
Step 1: Initialize the variables heads_counter and flip_counter to 0.
Step 2: A variable coin_flip is randomly assigned a value of either 0 or 1. If coin_flip has the value 0, the coin flip result is heads, so heads_counter is incremented by 1.
Step 3: Increment the value of flip_counter by 1.
Step 4: Repeat steps 2 and 3 until flip_counter equals 4.
Following the execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?
A. coin_flip = 1
B. flip_counter = 1
C. flip_counter = 2
D. heads_counter = 2
Computers and Technology
1 answer:
Leni [432]3 years ago
5 0

Answer:C

Explanation:

You might be interested in
write a c++ program that reads from the user a positive integer (in a decimal representation), and prints its binary (base 2) re
Vesna [10]

Answer:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int x1,rem,i=1; //defining integer variable

long Num=0;// defining long variable

cout << "Input a decimal number: "; // print message

cin >> x1; //input value by user

while (x1!=0) //loop for calculate binary number

{

//calculating binary value    

rem= x1%2;

x1=x1/2;

Num =Num +rem*i;//holding calculate value

i=i*10;

}

cout <<Num;//print value

return 0;

}

Output:

Input a decimal number: 76

1001100

Explanation:

In the above code, four variable "x1, rem, i, and Num" is declared, in which three "x1, rem, and i" is an integer variable, and one "Num" is a long variable.

  • In the x1 variable, we take input by the user and use the while loop to calculate its binary number.
  • In the loop, first, we check x1 variable value is not equal to 0, inside we calculate it binary number that store in long "Num" variable, after calculating its binary number the print method "cout" is used to prints its value.  
5 0
3 years ago
What is the difference between spyware and adware?
Sati [7]

Answer:

It's C

Explanation:

Adware displays or directs the users to an advertisement, while spyware performs espionage on the computer`s activity.

8 0
2 years ago
Read 2 more answers
Greg is writing a report on becoming an advertising and promotions manager. Complete the report by correctly filling in the miss
zzz [600]

Since Greg wants to become an advertising and promotions manager, he needs to at least gain a (B) bachelor’s degree level of education, since generally, this educational background is expected from individuals who wishes to work in an entry-level position in the field of advertising.

One of the skills that he also needs to develop is (C) communication skills, because he would have to be able to communicate in both written and spoken to develop the advertisements according to the client’s desires.

8 0
3 years ago
Using positive self talk is a great way to
lora16 [44]
Boost your self esteem and confidence.
7 0
2 years ago
Read 2 more answers
Which statement draws an accurate comparison between social media marketing and conventional marketing? Social media marketing i
wlad13 [49]
I think the best answer would be the last option.  Social media allow customers to express their views while conventional media do not. In social media, the viewers can freely right their comments and testimonials about a product. However, in conventional marketing like advertisements in televisions, the viewers cannot make direct comments to the company.
4 0
3 years ago
Other questions:
  • Bullets in a text box will do which of the following?
    9·2 answers
  • A list of pages within a Web site that you have visited and that usually appears at the top of a page is referred to as a(n) ___
    14·1 answer
  • Lonnie has several workbooks that contain financial and sales data. He needs to ensure that if the data in a single cell in one
    5·1 answer
  • write a function that takes a string as parameter, return true if it’s a valid variable name, false otherwise. You can use keywo
    6·1 answer
  • A software engineer is designing a new program. She decides to first define all the classes needed, and how they will interact w
    5·2 answers
  • What do you mean by data sequencing​
    13·1 answer
  • What is the difference between player-centric game design and designer-centric game design? How does a player-centric game assis
    7·1 answer
  • Write a c program using loops to generate following output.
    11·1 answer
  • Why is computer called information processing maching???​
    6·2 answers
  • Which of the following is NOT one of the three main ways to control a program when writing code?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!