Comp Sci Principles Semester 1 Final

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

The diagram below shows a circuit composed of three logic gates. Each gate takes two inputs and produces a single output. For which of the following input values will the circuit have an output of true ?

A = false, B = true, C = true, D = true

A code segment is intended to display the following output. up down down down up down down down Which of the following code segments can be used to display the intended output?

A.

A flowchart is a way to visually represent an algorithm. The flowchart below is used by an apartment rental Web site to set the variable to for apartments that meet certain criteria. Which of the following statements is equivalent to the algorithm in the flowchart?

A.

The diagram below shows a circuit composed of three logic gates. Each gate takes two inputs and produces a single output. For which of the following input values will the circuit have an output of false ?

A.

The following question uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom left square of the grid and facing right. Which of the following shows the location of the robot after running the code segment?

A.

The grid below contains a robot represented as a triangle, initially facing up. The robot can move into a white or gray square but cannot move into a black region. Which of the following replacements for Missing Code can be used to move the robot to the gray square?

A.

A file storage application allows users to save their files on cloud servers. A group of researchers gathered user data for the first eight years of the application's existence. Some of the data are summarized in the following graphs. The line graph on the left shows the number of registered users each year. The line graph on the right shows the total amount of data stored by all users each year. The circle graph shows the distribution of file sizes currently stored by all users. (note: 1 MB = 1,000 KB) Which of the following best describes the average amount of data stored per user for the first eight years of the application's existence?

A. Across all eight years, the average amount of data stored per user was about 10 GB.

Consider the following code segment. Which of the following replacements for <MISSING CONDITION> will result in an infinite loop?

A. j = 6

Consider a game where a player spins a wheel divided into four identical sections, labeled A, B, C, and D. If the player spins A, the score is 10. If the player spins B, the score is 5. If the player spins C or D, the score is -1. The following code segment is intended to implement the game. Which of the following could be used as a replacement for <MISSING STATEMENT> so the code segment works as intended? Responses

B.

Consider the following spinner, which is used to determine how pieces are to be moved on a game board. Each region is of equal size. Which of the following code segments can be used to simulate the behavior of the spinner?

B.

The code segment below is intended to swap the values of the variables first and second using a temporary variable, temp . Which of the following can be used to replace so that the code segment works as intended?

B.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the center square of the grid and facing toward the top of the grid. A gray square represents a possible final location of the robot after the code segment is executed. Which of the following represents all possible final locations for the robot?

B.

The grid below contains a robot represented as a triangle, initially facing right. The robot can move into a white or gray square but cannot move into a black region. The code segment below uses the procedure GoalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise. REPEAT UNTIL (GoalReached ()) { <MISSING CODE> } Which of the following replacements for <MISSING CODE> can be used to move the robot to the gray square?

B. REPEAT UNTIL (CAN_MOVE (forward) = false) { MOVE_FORWARD () } ROTATE_RIGHT ()

Which of the following best explains what happens when a new device is connected to the Internet?

B. An Internet Protocol (IP) address is assigned to the device.

Consider the code segment below. If the variables onTime and absent both have the value false, what is displayed as a result of running the code segment?

B. Better late than never.

Which of the following best explains how data is transmitted on the Internet?

B. Data is broken into packets, which can be sent along different paths.

Internet protocol version 6 (IPv6) has been introduced to replace the previous version (IPv4). Which of the following best describes a benefit of IPv6 over IPv4?

B. IPv6 allows for a greater number of addresses than IPv4, which allows more devices to be connected to the Internet.

The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing toward the top of the grid. Consider the procedure below. Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?

C.

Consider the following code segment. What is displayed as a result of executing the code segment?

C. 100 300 500

The player controls in a particular video game are represented by numbers. The controls and their corresponding binary values are shown in the following table. The numeric values for the controls can also be represented in decimal (base 10). What is the decimal value for the jump control?

C. 24

A video-streaming Web site uses 32-bit integers to count the number of times each video has been played. In anticipation of some videos being played more times than can be represented with 32 bits, the Web site is planning to change to 64-bit integers for the counter. Which of the following best describes the result of using 64-bit integers instead of 32-bit integers?

C. 2^32 times as many values can be represented.

Consider the following code segment. Which of the following initial values of the variable y would result in the variable z being set to 2 after the code segment is executed?

C. 3

Consider the following program, which uses the variables start, end, and current. What is displayed as a result of executing the program?

C. 3 4

A store uses binary numbers to assign a unique binary sequence to each item in its inventory. What is the minimum number of bits required for each binary sequence if the store has between 75 and 100 items in its inventory?

C. 7

An office uses an application to assign work to its staff members. The application uses a binary sequence to represent each of 100 staff members. What is the minimum number of bits needed to assign a unique bit sequence to each staff member?

C. 7

A certain programming language uses 4-bit binary sequences to represent nonnegative integers. For example, the binary sequence 0101 represents the corresponding decimal value 5. Using this programming language, a programmer attempts to add the decimal values 14 and 15 and assign the sum to the variable total. Which of the following best describes the result of this operation?

C. An overflow error will occur because 4 bits is not large enough to represent 29, the sum of 14 and 15.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom left square of the grid and facing right. The following programs are each intended to move the robot to the gray square. Program II uses the procedure GoalReached, which returns true if the robot is in the gray square and returns false otherwise. Which of the following statements best describes the correctness of the programs?

C. Both program I and program II correctly move the robot to the gray square.

In the following procedure, the parameters x and y are integers. Which of the following is the most appropriate documentation to appear with the calculate procedure?

C. Displays the value of (x + y) / x. The value of the parameter x must not be 0.

In the following procedure, assume that the parameter x is an integer. Which of the following best describes the behavior of the procedure?

C. It displays true if x is negative and displays nothing otherwise.

ASCII is a character-encoding scheme that uses 7 bits to represent each character. The decimal (base 10) values 65 through 90 represent the capital letters A through Z, as shown in the table below. What ASCII character is represented by the binary (base 2) number 1001010 ?

C. J

Which of the following is considered an unethical use of computer resources?

C. Purchasing a single-user copy of photo editing software and installing it on all the computers in a computer lab

The transmission control protocol (TCP) and Internet protocol (IP) are used in Internet communication. Which of the following best describes the purpose of these protocols?

C. To establish a common standard for sending messages between devices on the Internet

Consider the following code segment. x ←← 25 y ←← 50 z ←← 75 x ←← y y ←← z z ←← x Which of the variables have the value 50 after executing the code segment?

C. x and z only

Which of the following is a primary reason for the use of open protocols on the Internet?

D. Open protocols provide a way to standardize data transmission between different devices.

In a certain science experiment, percent of trials are expected to be successful and percent of trials are expected to be unsuccessful. The program below is intended to simulate the results of repeated trials of the experiment. Which of the following can be used to replace so that the simulation works as intended?

D. Random (1, 100) <= 75

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the bottom-left square of the grid and facing toward the top of the grid. Code for the procedure Mystery is shown below. Assume that the parameter p has been assigned a positive integer value (e.g., 1, 2, 3, ...). Which of the following shows a possible result of calling the procedure?

A.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially in the center square and facing toward the top of the grid. The following code segment is used to move the robot in the grid. count ←← 1 REPEAT 4 TIMES { REPEAT count TIMES { MOVE_FORWARD() } ROTATE_LEFT() count ←← count + 1 } Which of the following code segments will move the robot from the center square along the same path as the code segment above?

A. count ←← 0 REPEAT 4 TIMES { count ←← count + 1 REPEAT count TIMES { MOVE_FORWARD() } ROTATE_LEFT() }

Each student that enrolls at a school is assigned a unique ID number, which is stored as a binary number. The ID numbers increase sequentially by 1 with each newly enrolled student. If the ID number assigned to the last student who enrolled was the binary number 1001 0011, what binary number will be assigned to the next student who enrolls?

A. 1001 0100

The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ?

A. Boolean

A user wants to save a data file on an online storage site. The user wants to reduce the size of the file, if possible, and wants to be able to completely restore the file to its original version. Which of the following actions best supports the user's needs?

A. Compressing the file using a lossless compression algorithm before uploading it

Consider the following numeric values. Binary 1011 Binary 1101 Decimal 5 Decimal 12 Which of the following lists the values in order from least to greatest?

A. Decimal 5, binary 1011, decimal 12, binary 1101

The figure below shows a circuit composed of two logic gates. The output of the circuit is true. Which of the following is a true statement about input A?

A. Input A must be true.

A color in a computing application is represented by an RGB triplet that describes the amount of red, green, and blue, respectively, used to create the desired color. A selection of colors and their corresponding RGB triplets are shown in the following table. Each value is represented in decimal (base 10). According to information in the table, what color is represented by the binary RGB triplet (11111111, 11111111, 11110000) ?

A. Ivory

A video-streaming Web site keeps count of the number of times each video has been played since it was first added to the site. The count is updated each time a video is played and is displayed next to each video to show its popularity. At one time, the count for the most popular video was about two million. Sometime later, the same video displayed a seven-digit negative number as its count, while the counts for the other videos displayed correctly. Which of the following is the most likely explanation for the error?

A. The count for the video became larger than the maximum value allowed by the data type used to store the count.

Consider the following code segment. What are the contents of yourList after the code segment is executed?

A. [10, 30, 50, 70]

According to the domain name system (DNS), which of the following is a subdomain of the domain example.com?

A. about.example.com

Consider the following code segment. What are the values of first and second as a result of executing the code segment?

A. first = 100, second = 100

Consider the following procedure. The draw Circle procedure is to be used to draw the following figure on a coordinate grid. Let the value of the variable x be 2, the value of the variable y be 2, and the value of the variable r be 1. Which of the following code segments can be used to draw the figure?

B. drawCircle(x, y, r) drawCircle(x, y + 3, r) drawCircle(x + 3, y, r) drawCircle(x + 3, y + 3, r)

The figure below shows four grids, each containing a robot represented as a triangle. The robot cannot move to a black square or move beyond the edge of the grid. Which of the following algorithms will allow the robot to make a single circuit around the rectangular region of black squares, finishing in the exact location and direction that it started in each of the four grids?

B. Step 1: Keep moving forward, one square at a time, until the square to the right of the robot is no longer black. Step 2: Turn right and move one square forward. Step 3: Repeat steps 1 and 2 three more times.

Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm?

B. A lossless compression algorithm can guarantee reconstruction of original data, while a lossy compression algorithm cannot.

A student wrote the following code segment, which displays true if the list myList contains any duplicate values and displays false otherwise. The code segment compares pairs of list elements, setting containsDuplicates to true if any two elements are found to be equal in value. Which of the following best describes the behavior of how pairs of elements are compared?

B. The code segment iterates through myList, comparing each element to all subsequent elements in the list.

The variable age is to be used to represent a person's age, in years. Which of the following is the most appropriate data type for age?

B. number

A NAND gate is a type of logic gate that produces an output of only when both of its two inputs are . Otherwise, the gate produces an output of . Which of the following Boolean expressions correctly models a gate with inputs and ?

C.

The cost of a customer's electricity bill is based on the number of units of electricity the customer uses. For the first 25 units of electricity, the cost is $5 per unit. For units of electricity after the first 25, the cost is $7 per unit. Which of the following code segments correctly sets the value of the variable cost to the cost, in dollars, of using numUnits units of electricity?

C.

The grid below contains a robot represented as a triangle, initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region. The code segment below uses the procedure goalReached, which evaluates to true if the robot is in the gray square and evaluates to false otherwise. REPEAT UNTIL(goalReached()) { <MISSING CODE> } Which of the following replacements for <MISSING CODE> can be used to move the robot to the gray square?

C. IF(CAN_MOVE(left)) { ROTATE_LEFT() } MOVE_FORWARD()

A teacher is writing a code segment that will use variables to represent a student's name and whether or not the student is currently absent. Which of the following variables are most appropriate for the code segment?

C. A string variable named studentName and a Boolean variable named isAbsent

Digital images are often represented by the red, green, and blue values (an RGB triplet) of each individual pixel in the image. A photographer is manipulating a digital image and overwriting the original image. Which of the following describes a lossless transformation of the digital image?

C. Creating the negative of an image by creating a new RGB triplet for each pixel in which each value is calculated by subtracting the original value from 255. The negative of an image is reversed from the original; light areas appear dark, and colors are reversed.

In which of the following situations would it be most appropriate to choose lossy compression over lossless compression?

C. Storing music files on a smartphone in order to maximize the number of songs that can be stored

In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player is given 1 to 4 bonus round attempts. For each attempt, the player typically earns the extra points 70% of the time and does not earn the extra points 30% of the time. The following code segment can be used to simulate the bonus round. Which of the following is NOT a possible output of this simulation?

C. The player had 3 bonus round attempts and 7 of them earned extra points.

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below. ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56?

C. V

Consider a game in which a player flips a fair coin three times. If all three coin flips have the same result (either all heads or all tails) the player wins. Otherwise, the player loses. Which of the following code segments best simulates the behavior of the game?

D.

Consider the following spinner, which is used to determine how pieces are to be moved on a game board. The region labeled "Move 1 space" is six times as large as each of the other two regions. Which of the following code segments can be used to simulate the behavior of the spinner?

D.

The following grid contains a robot represented as a triangle. The robot is initially facing right. Which of the following code segments can be used to move the robot to the gray square along the path indicated by the arrows?

D.

The following grid contains a robot represented as a triangle, which is initially facing toward the top of the grid. The robot can move into a white or gray square but cannot move into a black region. Which of the following code segments can be used to move the robot to the gray square?

D. REPEAT 3 TIMES { MOVE_FORWARD() } ROTATE_LEFT() REPEAT 2 TIMES { MOVE_FORWARD() } ROTATE_RIGHT() REPEAT 3 TIMES { MOVE_FORWARD() }

The code fragment below is intended to display "odd" if the positive number num is odd. Which of the following can be used to replace <MISSING CONDITION> so that the code fragment will work as intended?

D. (num MOD 2) = 1

Consider the following code segment. Which of the following CANNOT be displayed as a result of executing the code segment?

D. 1 3 2 4

A flowchart provides a way to visually represent an algorithm and uses the following building blocks. In the flowchart below, assume that j and k are assigned integer values. Based on the algorithm represented in the flowchart, what value is displayed if j has the initial value 3 and k has the initial value 4 ?

D. 12

Consider the following code segment. What is displayed as a result of executing the code segment?

D. 21 40 30 50

Individuals sometimes attempt to remove personal information from the Internet. Which of the following is the LEAST likely reason the personal information is hard to remove?

D. All personal information is stored online using authentication measures, making the information hard to access.

Consider the following code segment. Which of the following describes the possible values of ans as a result of executing the code segment?

D. Any integer value from 7 to 16, inclusive

A video game character can face toward one of four directions: north, south, east, and west. Each direction is stored in memory as a sequence of four bits. A new version of the game is created in which the character can face toward one of eight directions, adding northwest, northeast, southwest, and southeast to the original four possibilities. Which of the following statements is true about how the eight directions must be stored in memory?

D. Four bits are enough to store the eight directions.

Consider the following code segment. What is displayed as a result of executing the code segment?

D. true true true

The following code segment is used to determine whether a customer is eligible for a discount on a movie ticket. val1 ←← (NOT (category = "new")) OR (age ≥ 65) val2 ←← (category = "new") AND (age < 12) If category is "new" and age is 20, what are the values of val1 and val2 as a result of executing the code segment?

D. val1 = false, val2 = false

The player controls in a particular video game are represented by numbers. The controls and their corresponding binary values are shown in the following table. The numeric values for the controls can also be represented in decimal (base 10). What control is represented by the decimal value 15 ?

D. ↓

The following grid contains a robot represented as a triangle, which is initially facing right. The following code segment is intended to move the robot to the gray square. <MISSING STATEMENT> { REPEAT 4 TIMES { MOVE_FORWARD() ROTATE_RIGHT() } ROTATE_LEFT() MOVE_FORWARD() ROTATE_RIGHT() } Which of the following can be used as a replacement for <MISSING STATEMENT> so that the code segment works as intended?

B. REPEAT 2 TIMES

A state government is attempting to reduce the digital divide. Which of the following activities has the greatest potential to contribute to the digital divide rather than reducing it?

B. Requiring applicants for government jobs to apply using an online platform

Which of the following is an advantage of a lossless compression algorithm over a lossy compression algorithm?

B. The Internet is designed to scale to support an increasing number of users.

A student is creating an application that allows customers to order food for delivery from a local restaurant. Which of the following is LEAST likely to be an input provided by a customer using the application?

B. The cost of a food item currently available for order

A computer program performs the operation 2+3 and represents the result as the value 0.6666667. Which of the following best explains this result?

B. The precision of the result is limited due to the constraints of using a floating-point representation.

Consider the following program. Which of the following describes the result of executing the program?

B. The program displays the sum of the even integers from 2 to 20.

The diagram below shows a circuit composed of two logic gates labeled OR and AND. Each gate takes two inputs and produces a single output. If the inputs A and C are both true, which of the following best describes the output of the AND gate?

A. The output will be true no matter what the value of input B is.

Consider the following code segment, which uses the variables r, s, and t. r ← 1 s ← 2 t ← 3 r ← s s ← t DISPLAY (r) DISPLAY (s) What is displayed as a result of running the code segment?

C. 23

An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set the following Boolean variables. The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?

B. (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

Consider the following code segment. What is the value of r as a result of executing the code segment?

B. 20

In the program below, y is a positive integer (e.g., 1, 2, 3, ...). What is the value of after running the program?

B. 3y

A sorted list of numbers contains 200 elements. Which of the following is closest to the maximum number of list elements that will need to be examined when performing a binary search for a particular value in the list?

B. 8

A student is creating an algorithm to display the distance between the numbers num1 and num2 on a number line. The following table shows the distance for several different values. Which of the following algorithms displays the correct distance for all possible values of num1 and num2?

B. Step 1: Subtract num1 from num2 and store the result in the variable diff. Step 2: Take the absolute value of diff and display the result.

Let n be an integer value. Which of the following expressions evaluates to true if and only if n is a two-digit integer (i.e., in the range from 10 to 99, inclusive)?

B. (n ≥ 10) AND (n < 100)

To be eligible for a particular ride at an amusement park, a person must be at least 12 years old and must be between 50 and 80 inches tall, inclusive. Let age represent a person's age, in years, and let height represent the person's height, in inches. Which of the following expressions evaluates to true if and only if the person is eligible for the ride?

A. (age ≥ 12) AND ((height ≥ 50) AND (height ≤ 80))

Which of the following algorithms display all integers between 1 and 20, inclusive, that are not divisible by 3 ? Select two answers.

A. and D. A. Step 1: Set x to 0. Step 2: Increment x by 1. Step 3: If x is not divisible by 3, then display x. Step 4: Repeat steps 2 and 3 until x is 20. D. Step 1: Set x to 1. Step 2: If x is divisible by 3, then do nothing; otherwise display x.Step 3: Increment x by 1. Step 4: Repeat steps 2 and 3 until x is greater than 20.

A spinner contains 12 regions of equal size. The regions are numbered 1 to 12. Which of the following code segments can be used to simulate the results of spinning the spinner three times and assigns the sum of the values obtained by the three spins to the variable sum ?

A. sum ← RANDOM(1, 12) + RANDOM(1, 12) + RANDOM(1, 12)

A color in a computing application is represented by an RGB triplet that describes the amount of red, green, and blue, respectively, used to create the desired color. A selection of colors and their corresponding RGB triplets are shown in the following table. Each value is represented in decimal (base 10). What is the binary RGB triplet for the color indigo?

C. (01001011, 00000000, 10000010)

To qualify for a particular scholarship, a student must have an overall grade point average of 3.0 or above and must have a science grade point average of over 3.2. Let overallGPA represent a student's overall grade point average and let scienceGPA represent the student's science grade point average. Which of the following expressions evaluates to true if the student is eligible for the scholarship and evaluates to false otherwise?

C. (overallGPA ≥ 3.0) AND (scienceGPA > 3.2)

A game is played by moving a game piece left or right along a horizontal game board. The board consists of spaces of various colors, as shown. The circle represents the initial location of the game piece. The following algorithm indicates how the game is played. The game continues until the game is either won by landing on the red space or lost when the piece moves off either end of the board. Step 1:Place a game piece on a space that is not red and set a counter to 0. Step 2:If the game piece is on a yellow space, move the game piece 3 positions to the left and go to step 3. Otherwise, if the game piece is on a black space, move the game piece 1 position to the left and go to step 3. Otherwise, if the game piece is on a green space, move the game piece 2 positions to the right and go to step 3. Step 3:Increase the value of the counter by 1. Step 4:If game piece is on the red space or moved off the end of the game board, the game is complete. Otherwise, go back to step 2. If a game is begun by placing the game piece on the rightmost black space for step 1, what will be the value of the counter at the end of the game?

C. 4

Consider the 4-bit binary numbers 0011, 0110, and 1111. Which of the following decimal values is NOT equal to one of these binary numbers?

C. 9

Internet protocol version 4 (IPv4) represents each IP address as a 32-bit binary number. Internet protocol version 6 (IPv6) represents each IP address as a 128-bit binary number. Which of the following best describes the result of using 128-bit addresses instead of 32-bit addresses?

D.

A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following algorithms can be used to accomplish the teacher's goal?

D. Step 1: Assign each student a unique integer from 1 to 30. Step 2: Generate a random integer n from 1 to 30. Step 3: Select the student who is currently assigned integer n and display the student's name. Step 4: The student who was selected in the previous step is assigned 0. All other students are reassigned a unique integer from 1 to 29. Step 5: Generate a new random integer n from 1 to 29. Step 6: Select the student who is currently assigned integer n and display the student's name.

Grades in a computer science course are based on total points earned on a midterm exam and a final exam. The teacher provides a way for students to improve their course grades if they receive high scores on the final exam: if a student's final exam score is greater than the student's midterm exam score, the final exam score replaces the midterm exam score in the calculation of total points. The table below shows two students' scores on the midterm and final exams and the calculated total points each student earns. Khalil does better on the midterm exam than on the final exam, so his original midterm and final exam scores are added to compute his total points. Josefina does better on the final exam than on the midterm exam, so her final exam score replaces her midterm exam score in the total points calculation. The teacher has data representing the scores of thousands of students. For each student, the data contain the student name, the midterm exam score, the final exam score, and the result of the total points calculation. Which of the following could be determined from the data? I. The average total points earned per student II. The average increase in total points per student as a result of the score replacement policy III. The proportion of students who improved their total points as a result of the score replacement policy

D. I, II, and III

Consider the following code segment. Which of the following best describes the behavior of the code segment?

D. The code segment displays the value of 2(5^3) by initializing result to 2 and then multiplying result by 5 a total of three times.

Consider the following program. Which of the following describes the result of executing the program?

D. The program displays the sum of the odd integers from 1 to 19.

The algorithm below is used to simulate the results of flipping a coin 4 times. Consider the goal of determining whether the simulation 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 execution of the algorithm, which of the following expressions indicates that the simulation resulted in an equal number of heads and tails?

D. heads_counter = 2


Set pelajaran terkait

Pharm Ch. 8 tetracyclines, macrolides, lincosamides (prep u, vocab + quizletA)

View Set

California Real Estate Chapter 10

View Set

what are two types of planets in our solar system

View Set

Neuropsychological disorders of self-awareness 6B

View Set

Microeconomics: Chapter 4 Graded Homework

View Set

Chapter 3 Expansion and Establishment

View Set