CSP Finals Study Guide

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

The Domain Name System (DNS) is designed to

Allow for nested domain naming (e.g., digitalportfolio.collegeboard.org ), and Use cache and redundant servers for quick matching of IP addresses to domain names

How do computing devices represent information?

A computer represents data as bits with is either a 0 or a 1.

Computing System

A group of computers working together for a common purpose.

Computing Network

A group of connected computers that can send or receive data.

Computing Device

A machine that can run a program

Path

A sequence of direct connections.

Which one of the following is NOT a benefit of the HTTPS protocol?

HTTPS ensures that only the client and the server can view the packets sent during their communication and they cannot be intercepted by a third party.

Which of the following Internet protocols is used to request and send pages and files on the World Wide Web?

HyperText Transfer Protocol (HTTP)

This problem is about different algorithms carried out of a row of numbered cards on a table. Each card has a number, there is an even number of cards, and they are in no special order. Which of the following algorithms is most likely to involve selection AND iteration?

Look over all the cards to find the smallest one, and move it to the leftmost position.

What is lossy compression?

Removing some of the data from a file to reduce its size.

Two grids are shown below. Each grid contains a robot represented as a triangle. Both robots are initially facing right. Each robot can move into a white or gray square, but cannot move into a black region.) For each grid, the program below is intended to move the robot to the gray square. The program uses the procedure Home(), which evaluates to true if the robot is in the gray square and evaluates to false otherwise. REPEAT UNTIL (Home ()) { IF (CAN_MOVE (right)) { ROTATE_RIGHT () } ELSE { IF (CAN_MOVE (left)) { ROTATE_LEFT () } } IF (CAN_MOVE (forward)) { MOVE_FORWARD () } } For which grid(s) does the program correctly move the robot to the gray square?

The grid on the left.

What will be displayed when the following program is executed? list ← [1, 3, 5] FOR EACH item IN list { DISPLAY (item MOD 3) }

1 0 2

Consider the following program that is intended to calculate the sum of all items in a list: FOR EACH item IN list { sum ← 0 sum ← sum + number } DISPLAY ( sum ) What will be the output printed if list ←[0, 5, -3, 4]?

4

Which of the following is NOT a reason to include comments in programs?

Comments help the computer decide whether certain components of a program are important.

Which of the following can be represented by a sequence of 3 bits?

I only

what is the purpose for IP adresses

IP addresses provide a unique number for identifying devices that send and receive information on the Internet

FOUR INDEPENDENT ALGORITHMS listed below can be executed on a row of NUMBER cards (Not FACE cards) on a table. There are an EVEN number of cards,and they are in no special order. Which of the Algorithms involves BOTH Selection and Iteration?

Look over all the cards to find the smallest one, and move it to the leftmost position and Compare the values of each pair of cards. For example, compare cards 0 and 1, compare cards 2 and 3, and so on for all pairs. Swap positions when the first card is greater than the second of the pair

Which of the following is an example of how the digital divide can affect data collection and analysis?

Members of an online social network are asked to watch a streaming video about a current event, and answer a survey. People on low-bandwidth networks that cannot handle streaming video would be unlikely to respond.

Implementing procedures in a program generally considered good coding practice. Which of the following are valid explanations as to why procedures are considered good practice?

Procedures can be used to implement repeated code thereby increasing readability of an overall program, and Procedures can be tested individually before inclusion in the overall program. On average, this decreases the time spent debugging programs.

Which of the following best describes the result of running the program code?

The index of the largest number in list is displayed

What is the primary function of the Internet?

to connect devices and networks all over the world.

You are writing a function called swap (list, x, y) which will exchange the position of the two values at indexes x and y in the list.

var temp ← list[y]; list[y] ← list[x]; list[x] ← temp;

what is an example of abstraction

If you are driving a car, you may not know how the engine works, but you can use the steering wheel and pedals as an interface to control where the car goes.

Which one of these would be least likely to make programming code easily modifiable in the future?

Creating more procedures for the program.

How many asterisks (*) will the code below display? i=1 REPEAT UNTIL i<0 DISPLAY * i=i+1

Infinite

Binary 1101 Decimal 14Hexadecimal F Which of the following lists them from least to greatest

Binary 1101, Decimal 14, Hexadecimal F

How many total numbers can be represented with an 8-bit binary system

256

How many times will the following loop be executed? x ← 0 REPEAT UNTIL (x > 5) IF (x MOD 2 = 0) x ← x - 1 IF (NOT (x MOD 2) = 0) x ← x + 3

3

Which two of the following statements are true about routing on the Internet? Select two answers.

A packet travelling between two computers on the Internet may be rerouted many times along the way and A packet contains addressing information to allow routers to decide how best to forward along that packet towards its destination.

Which is true of abstraction?

Abstraction extracts common features from specific examples to generalize concepts.

A crime investigator is accessing an online database of crimes within a certain radius of the city center. The database contains the following information: Date of crime Name of offender Neighborhood of crime The investigator is looking for other crimes that occurred in a certain area on a certain date. Which of the following algorithms can be used to find all crimes that occurred in a certain neighborhood on a certain day? I. Make a new list by filtering the data so only the crimes from a certain neighborhood are on the list. Perform multiple binary searches to find all crimes that occurred in that neighborhood on a certain day, adding each new occurrence to a final list. II. Make a new list by filtering the data so only the crimes from a certain neighborhood are on the list. Perform multiple linear searches to find all crimes that occurred on the given day, adding each new occurrence to a final list.

Algorithm II always works correctly, but Algorithm I only works correctly when the date data is sorted.

Which of the following is true of algorithms? Select two answers

Algorithms are composed of commands which implement sequencing, iteration, and selection by which a task can be completed on a computer and Clarity and readability are important considerations when expressing an algorithm in a language.

Which algorithm best describes the program below? items ← 0 FOR EACH name IN nameList items ← items + 1 DISPLAY items

An algorithm to find the number of names in a list.

You were hired as a manager of a set of new programmers because of your experience in generating quality code. One of your new programmers brings a solution which looks nothing like what you would generate for the same problem. Which of the following might be a good next step?

Analyze the solution for correctness and readability and Realize that there are multiple ways to solve most problems and work to understand this employee's solution.

You write an algorithm in your program to that calculates and prints the total miles traveled during a road trip. When you test your algorithm, it does not print the correct value. Which of the following would NOT be a productive way to debug the code?

Delete the entire algorithm and start over

Compression techniques (lossy or lossless) can do the following, EXCEPT:

Enlarge a file in order to increase the resolution in the original, thereby increasing the file size

When building internet networks it is important to consider redundancy. Which of the following is an example of redundancy?

Ensuring that if any single node in the network were to stop working, packets can still be delivered

The various protocols used on the internet operate in layers in which the protocol at each layer rely on the protocols at the lower layers to do their jobs, and higher layers (higher level of abstraction) are built on top of the lower layers (lower level of abstraction). =elect two answers.

HTTP is a higher level of abstraction than TCP/IP, and DNS is a higher level of abstraction than TCP/IP

What are some of the advantages of using models and simulations to mimic a real-world process or system under study? I. Models and simulations mimic real-world events without the cost or danger of real world prototypes or testing. II. The results of models and simulations may generate new knowledge and new hypotheses related to the phenomena being modeled. III. We cannot change the model or simulation as rapidly as we can change the real-world process or system under study, therefore, it allows us to minimize iterations in a model or simulation.

I and II only

In the following code block, assume that the variables Rainy and too_cold are boolean. IF (NOT (Rainy OR too_cold)){DISPLAY("It's a good beach day")}Which of the following are equivalent to the above code block?

IF ((NOT rainy) AND (NOT tooCold)){DISPLAY("It's a good beach day"}

In the following code block, assume that the variables rainy and too_Cold are boolean. IF (NOT(rainy) AND NOT(too_Cold)){DISPLAY("It's a good beach day")}Which of the following are equivalent to the above code block?

IF (NOT (rainy OR too_Cold)){DISPLAY("It's a good beach day")}

A student is taking a survey of her class in order to determine their average hours of sleep per night. She is tracking the number of students in her class that have replied. She sees that the number of students who have replied is represented by the digits "12" but she does not remember what base she used. Which of the following are possible bases that the number 12 could be in? I. Binary (base 2) II. Decimal (base 10)III. Hexadecimal (base 16)

II and III

Arrange the following four values from smallest to largest.I. Decimal 200II. Binary 11000011III. Hexadecimal C0IV. Decimal 100

IV, III, II, I

Which of the following is NOT true regarding metadata?

In photos, metadata is hidden within the image and is stripped out using pixel processing methods.

Which of the following BEST describes the differences between sequential and event-driven programming?

In sequential programming commands run in the order they are written. In event-driven programming some commands run in response to user interactions or other events.

Frances wants to develop an algorithm to compute the arithmetic mean of a list of numbers. After four attempts to implement the algorithm, the following code was tested and found to correctly compute and display the total sum of all the numbers in the list. total ← 0 items ← 0 FOR EACH number IN numList { total ← total + number <MISSING CODE 1>} DISPLAY totalDISPLAY items <MISSING CODE 2> Which lines of code need to be added so that the algorithm displays the arithmetic mean of the numbers in numList?

Missing code 1: items ← items+1, Missing code 2: DISPLAY (total / items)

You have been hired by a company to generate a simulation of a process within their multinational company. You try to convince them that there is significant value to starting with a simple model even though it might not model their process exactly. Which arguments below are viable supports for your position?

Models and simulations often omit unnecessary features of the objects or phenomena under investigation, and Simple models and simulations will execute faster allowing more opportunity for rapid testing and development.

The question below uses a robot in a grid of squares. The robot is represented as a triangle, which is initially at the bottom left square facing up. 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? Choose two answers.

REPEAT 3 TIMES { REPEAT UNTIL (CAN_MOVE(right)) { MOVE_FORWARD () } ROTATE_RIGHT () } MOVE_FORWARD () num = 17 REPEAT UNTIL (num = 0) { IF( CAN_MOVE (forward) ) { MOVE_FORWARD () } ELSE { ROTATE_RIGHT () } num = num - 1 }

Consider an algorithm that simulates rolling two number die, Die1 and Die2, with the numbers 1 - 6, and then displays the sum of the two cubes' values. If the sum is greater than 10, the phrase "You are a Winner!" displays, otherwise, "You have Lost!" displays. Put the steps of the algorithm in order. Select two answers. Step 1: Assign random values between 1 and 6 to Die1. Step 2: If sum is greater than 10, display "You are a Winner!". Step 3: Display sum. Step 4: If the sum if less than or equal to 10, display "You have Lost!". Step 5: Assign random values between 1 and 6 to Die2. Step 6: Assign the value of Die1 + Die2 to sum.

Step 1, Step 5, Step 6, Step 3, Step 4, Step Step 5, Step 1, Step 6, Step 3, Step 2, Step 4

Which of the is not true when considering the impact of the Internet?

The Internet has impacted the entire world equally such that all citizens of the world have equal opportunity to share the innovation it enables.

Which of the following is a characteristic of the fault-tolerant nature of communication on the Internet?

The ability to provide data transmission even when some connections have failed.

examples of lossy compression

The image is divided into squares that are 2 by 2 pixels each. Each square is translated into a single pixel whose color is the average of the color values from the 4 pixels in the square.

Which of the following is true of how the Internet has responded to the increasing number of devices now using the network?

The protocols of the Internet were designed to scale as new devices are added

The procedure Move(distance) is used in conjunction with Turn(angle)to draw a shape. The parameter distance can be any positive integer. The parameter angle can be any integer between 0 and 360, inclusive. Consider the following program, where the cursor starts at the center of the screen. Move (100) Turn (120) Move (100) Turn (120) Move (100) Turn (120) Move (100) Turn (120) Which of the following represents the figure that is drawn by the program?

This option is correct. The first three sets of Move/Turn draw the triangle. The last set overwrites the first leg.

Which of the following Internet protocols is MOST important in reassembling packets and requesting missing packets to form complete messages?

Transmission Control Protocol (TCP)

An architecture company is planning to build a tower in California but they are worried about earthquakes. They decide to use a computer simulation in order to test the safety of different designs when an earthquake occurs. Which of the following are reasons to use a simulation in this context?

Using the simulation software can save the company money because it allows them to test building materials for safety without purchasing physical materials.

What is network redundancy?

a process through which additional or alternate instances of network devices, equipment and communication mediums are installed within network infrastructure. It is a method for ensuring network availability in case of a network device or path failure and unavailability.

The initial position is given below for a robot in a grid of squares. The code for the procedure Mystery is shown below. Assume that the parameter n is a positive integer value. Which of the following shows a possible result of calling the procedure?

option A

Which code segment will compute (and store) the product of all the numbers contained in the list, numList, assuming there is at least one item in the list?

product ← 1 FOR EACH num IN numList { product ← product * num }

You write a program in which the proper motions are carried out the correct number of times but they are executed in an incorrect order. This is a most likely a problem in the ________ of the program.

sequencing


Ensembles d'études connexes

Test 2 Chapter 6: Effects on material misstatement increase or decrease part 2

View Set

****BA109 Module 6 Exam (Chapters 1-5)****

View Set

Skills USA Knowledge questions 2024 study guide

View Set

Med Surg Chapter 15: Cancer Study Questions, Lewis Chapter 15 Cancer, Chapter 15: Cancer

View Set

Writing - Organization and Form - Definition

View Set