AP Computer Science Principles Unit 1-4 Assessments answers

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

10. Which of the following are true statements about digital certificates in Web browsers? I. Digital certificates are used to verify the ownership of encrypted keys used in secured communication II. Digital certificates are used to verify that the connection to a Web site is fault tolerant. A. I only B. II only C. I and II D. Neither I nor II

A

8 bits is enough to represent 256 different numbers. How many total bits do you need to represent 512 (twice as many) numbers? A. 9 bits B. 10 bits C. 16 bits D. 17 bits

A

Approximately how much bigger (how many more bytes) is a megabyte than a kilobyte? A. 1,000 times bigger B. 100,000 times bigger C. 1,000,000 times bigger D. 1,000,000,000 times bigger

A

Consider the following incorrect program, which is intended to move the robot around the perimeter of a grid, as indicated by the drawing below. The starting position and direction of the robot is indicated in the diagram. Line 1: REPEAT 4 TIMES Line 2: { Line 3: MOVE_FORWARD() Line 4: ROTATE_RIGHT() Line 5: MOVE_FORWARD() Line 6: MOVE_FORWARD() Line 7: MOVE_FORWARD() Line 8: MOVE_FORWARD() Line 9: ROTATE_RIGHT() Line 10: } Fig: What the robot is supposed to do Given the options below, which lines should be removed so the program will work as intended? A. Line 3 and Line 4 B. Lines 5, 6, 7, 8 and 9 C. Line 8 and Line 9 D. Line 9

A

Fill in the blank of the following statement: "______ encryption is a method of encryption involving one key for both encryption and decryption." A. Symmetric B. Asymmetric C. Public key D. SSL

A

How does a computer resolve a domain name into an IP address? A. It asks a DNS server for the corresponding IP address B. It scans addresses until it finds the one it's looking for C. It uses a Border Gateway Protocol to get the address from a nearby computer. D. It creates an IP address for the domain, and shares it with the closest DNS.

A

The colors of the pixels in a digital image are often represented by red, green, and blue values between 0 and 255 (an RGB triplet). A photographer is manipulating a digital image to lighten it because all of the RGB values in the image are less than 100, making it very dark. He does this by adding 20 to the R, G, and B values of each pixel, then overwriting the original image. What type of transformation is the photographer using on the digital image? A. Lossless transformation B. Lossy transformation C. Multiband transformation D. Chrome Sampling transformation

A

Pick the two expressions involving the Modulo operation that compute to the exact same value (choose 2) A. 9 MOD 8 B. 1 MOD 16 C. 52 MOD 32 D. 9 MOD 64

A,B

Programming languages have some similarities and differences to the "natural" language you use in everyday speech. Select the two true statements about programming languages: A. Ambiguities in natural language necessitate the creation of programming languages for controlling a computer B. Compared to the number of words in a natural language, the number of defined words in a programming language is very small. C. The number of defined words in a programming language is about the same as the number of words in a natural language. D. There are typically many possible ways to interpret an instruction written in a programming language.

A,B

Consider the following three binary numbers: 01010 010000 1110 Which of the following lists the numbers in order from least to greatest? A. 010000 1110 01010 B. 01010 1110 010000 C. 01010 010000 1110 D. 1110 01010 010000

B

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a circle of any size at any point on the screen A. Loop B. Function(s)

B

What is the 4-bit binary number for the decimal number Ten (10)? A. 0010 B. 1010 C. 0110 D. 0101

B

Which of the following is NOT true about TCP/IP packets? A. Packets are numbered so if they arrive out of order the message can be reassembled. B. TCP guarantees that no packets are ever dropped C. Packets can be routed on different paths from sender to receiver. D. Messages are broken into packets to improve reliability of the internet

B

Which of the following will call the function drawStar? A. drawStar; B. drawStar(); C. function drawStar() { for (var i= 0; i <5; i++) { moveforward(100); turnLeft(36); D. function drawStar; E. fucntion drawStar();

B

Why are parameters useful when programming? A. Parameters determine the number of times the function will run. B. Parameters allow for more flexible, generalized behaviors in functions. C. Parameters are useful for teams of programmers because they help define the boundaries of the problem they are trying to solve. D. Parameters change the order of operations within a function.

B

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem? A. When the problem can be solved in a reasonable time and an approximate solution is acceptable B. When the problem can be solved in a reasonable time and an exact solution is needed C. When the problem cannot be solved in a reasonable time and an approximate solution is acceptable D. When the problem cannot be solved in a reasonable time and an exact solution is needed

C

When programmers work together, what is an example of how abstraction in programming can promote collaboration? A. Team members can rely on one another to explain their code. B. Programmers can write functions without needing to know what they do or how they should work. C. Programmers can use functions created by their partners, relying on the functionality without needing to know the specific details of how the function is implemented. D. In order for programmers to work together, they must work in the same room. E. Abstraction allows programmers to brainstorm more creative solutions to problems.

C

Which of the following most accurately describes Moore's Law: A. Moore's Law describes a relationship of boolean logic statements involving AND and OR B. Moore's Law is the principle that one should assume that any traffic on the Internet is insecure C. Moore's Law is the observation that computing power tends to double every two years D. Moore's Law explains why cracking modern cryptography is a "computationally hard" problem

C

9. 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. A-65 B-66 C-67 D-68 ASCII characters can also be represented by binary numbers. According to ASCII character encoding, which of the following letters is represented by the 8-bit binary value: 0100 0010 A. ASCII Character: A B. ASCII Character: B C. ASCII Character: D D. The table does not contain the value represented by the binary number 0100 0010

B

Use Top-Down Design strategy to fill in the table below. The first line is given to you. You may use as many or as few rows in the table as you see fit. NOTE: Use a new line for each entry to the table. Write each line in the format of "Function Name : Description" Top-Down Design Strategy: Look at the big picture... Identify a sub-task... Break down that sub-task into smaller sub-task(s)... Keep going until you're down to the commands you already have access to. Function Name Description / Justification drawSnowflake() Draw a 6 pointed snowflake (Your answer) (Your answer)

DrawSnowflake() { for(var i=0; i<7; i++) { turnRight(i*60); moveForward(); moveBackward(); } }

Which one of the following statements about functions is TRUE A. A function can change names over the course of a program. B. Code can be added or removed dynamically from a function while the program is running. C. Functions can be called using different names depending on where in the program they are called. D. Two functions can be given identical names as long as their code is identical. E. Two functions in a single program can have different names but contain identical code.

E

A compression scheme for long strings of bits called run-length encoding is described as follows: Rather than record each 0 and 1 individually, instead record "runs" of bits by storing the number of consecutive 1s and 0s that appear. Since it's binary, any run of 0s must be followed by a run of 1s (even if the run is only 1-bit long) and vice versa. Thus, you can store a list of small numbers that represents the alternating runs of 0s and 1s. Here is an example: To uncompress the data back into its original binary state, you simply reverse the process. This technique is an example of what type of compression? A. Lossy compression B. Lossless compression C. Fast Fourier Transform compression D. Tailored compression

B

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing out the letters of a word "HELLO" A. Loop B. Function(s)

B

What is the best explanation for why digital data is represented in computers in binary? A. The binary number system is the only system flexible enough to allow for representing data other than numbers. B. It's easier, cheaper, and more reliable to build machines and devices that only have to distinguish between binary states. C. It typically takes fewer digits to represent a number in binary when compared to other number systems (for example, the decimal number system) D. It's impossible to build a computing machine that uses anything but binary to represent numbers

B

Which of the following BEST describes how protocols on the Internet (e.g. IP, TCP, HTTP) make use of abstraction to accomplish their respective purposes? A. High level protocols take into account specific implementation details of lower level protocols to ensure they are compatible. B. Low level protocols can provide functionality to high level protocols without revealing the details of how this is accomplished. C. Low level protocols are written in binary while high level protocols are written in hexadecimal. D. High level protocols can take on the role of a low level protocol in the event of failure in the system.

B

Which of the following scenarios is most characteristic of a phishing attack. A. You accidentally run a piece of code that automatically spreads from one computer to another, exploiting a common vulnerability B. You get an email from the IT support desk that asks you to send a reply email with your username and password to verify your account C. You get an unwanted email trying to sell you a low quality product or service that seems "fishy." D. You accidentally install a piece of software that monitors your activity to steal personal information like your passwords, date of birth, social security number, etc.

B

Which of the following images represents the most likely output produced by the code segment given below? A. B. C. D. E.

B (ARROW END POINTED LEFT AT THE END OF ONE LINE DOWN)

10. Two students have developed a protocol in which they send 4-bit messages to each other. They decide to modify their protocol to start sending 8-bit messages instead. How many more values can be represented in an 8-bit message than a 4-bit message? A. 21 = 2 times as many values B. 22 = 4 times as many values C. 23 = 8 times as many values D. 24 = 16 times as many values

D

14. What is the most likely outcome of running the code shown at right? A. It will draw a star with each side 150 pixels long. B. The program will stop with an error at line 3 because parameters may not be used in for loops. C. The program will stop with an error at line 5 because it is dividing by 0. D. The program will run without error, but will not draw anything.

D

A programmer is writing a system that is intended to be able to store large amounts of personal data. As the programmer develops the data system, which of the following is LEAST likely to impact the programmer's choices in designing the structure of the system? A. Maintaining privacy of the information stored in the data set. B. Scalability of the system. C. Structuring the metadata of the information for analysis. D. The frequency of a particular item occurring in a data set.

D

A school starts tracking which websites each computer in the school is visiting by monitoring the packets leaving the school. A sample of the information they have collected appears below: IP Address Time URL ... ... ... 1.1.1.1 11:05:23.22 example.com 1.5.1.8 11:05:29.71 news.com 1.1.5.1 11:06:13.48 sports.com 1.5.1.8 11:08:09.95 example.com ... ... ... 1.1.5.1 17:04:29.20 news.com Which of the following is MOST likely to be answerable using all the data collected by this monitoring? A. Which students are visiting social media sites from school B. Which classes are assigning the most homework using the computers C. Which programs students are running on the lab computers D. Which websites are most frequently visited before and after school hours from a school computer

D

Number systems with different bases such as binary (base-2) and decimal (base-10) are all used to view and represent digital data. Which of the following is NOT true about representing digital data? A. At one of the lowest levels of abstraction, all digital data can be represented in binary using only combinations of the digits zero and one. B. The same value (number) can have a different representation depending on the number system used to represent it. C. Groups of bits can be used to represent abstractions, including but not limited to numbers and characters. D. Some large numbers cannot be represented in binary and can only be represented in decimal.

D

Select the answer that lists the units of bytes in ascending order (from smallest to largest) A. gigabyte, megabyte, terabyte B. megabyte, terabyte, kilobyte C. gigabyte, terabyte, megabyte D. kilobyte, gigabyte, terabyte

D

The world is currently in a transition to using IPv6, a newer version of the IP protocol that uses 128-bit addresses instead of 32-bit addresses used by IPv4. What is the main problem that IPv6 was created to solve? A. 32-bit addresses could not accommodate the increased size and amount of data traveling on the Internet as it has grown in popularity B. IPv6 will allow problems with IPv4's address hierarchy to be resolved C. IPv4 proved unreliable in some cases where network redundancy could not be ensured D. 32-bit addresses could not ensure that every internet-connected device can receive a unique IP address

D

Which of the following is a true statement about data compression? A. Data compression is only useful for files being transmitted over the Internet. B. Regardless of the compression technique used, once a data file is compressed, it cannot be restored to its original state. C. Sending a compressed version of a file ensures that the contents of the file cannot be intercepted by an unauthorized user. D. There are trade-offs involved in choosing a compression technique for storing and transmitting data.

D

Which of the following is true about the way digital data is transmitted on the Internet? A. Bit-rate (bandwidth) is the time elapsed between the transmission and receipt of a piece of digital data. B. Latency is the amount of data (measured in bits) that can be sent in a fixed amount of time. C. Digital data can only be transmitted between two devices when they are physically connected to one another (for example by a copper wire) D. Two devices must communicate using the same bit-rate to successfully send and receive digital data.

D

Explain how abstraction allows for the creation of increasingly complex systems. Reference top-down design strategy in your response.

Abstraction allows you to call functions inside of functions. To make a grid, you would call a drawBox function within the drawGrid function. That is a top down design. Instead of having to write the drawbox code every time you draw a box, you could call the drawBox function within the drawGrid function to make it easier on the programmer. The complexity also increases, as a grid is easily drawn and is more complex than just one square.

A middle school is expanding to open a high school next year, doubling the total number of students. The school keeps a database in which each student's unique ID number is stored as an 8 bit number called studentID. Before the arrival of the new students almost every 8 bit number has already been assigned to a student. Of the options provided below, which is the smallest change to the way studentID is represented necessary to ensure each incoming student receives a unique ID? A. Add a bit to studentID to double the number of IDs that the database can represent. B. Double the number of bits in studentID to double the number of IDs that the database can represent C. Keep using an 8-bit number for studentID but reserve the first bit to indicate middle school or high school. D. Remove a bit from studentID to make room for incoming students

A

A raw digital sound file samples a sound wave at some interval and measures the height of the wave at each point. Thus, raw sound is recorded as a list of numbers. In very broad terms the MP3 audio compression algorithm identifies frequencies and volume levels - low and high - that are outside the range of human hearing and removes the data representing these frequencies from the original. This technique results in a smaller audio file that sounds exactly the same to the human ear. This technique is an example of what type of compression? A. Lossy compression B. Lossless compression C. Fast Fourier Transform compression D. Tailored compression

A

According to the domain name system (DNS), which of the following is a subdomain of the domain example.com? A. about.example.com B. example.co.uk C. example.com.org D. example.org

A

An artist makes an RGB raster image in which each pixel color is encoded with 12-bits --- 4 bits each for red, green and blue. Which of the following correctly shows the hexadecimal value for Red as a 12-bit representation. A. F00 B. 00F C. FF00 D. FF0000

A

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing 100 tiny dots in a line A. Loop B. Function(s)

A

For this scenario related to turtle drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task: Drawing a hexagon (six-sided shape) A. Loop B. Function(s)

A

Which of the following statements best describes the properties of public key encryption? A. Public key encryption is an encryption method which relies on separate keys for encrypting and decrypting information. B. Public key encryption is a highly secure encryption scheme that in which a single shared key is used by both the sender and receiver of the message. C. Public key encryption makes use of certain types of problems which are easier for humans to solve than computers. D. Public key encryption makes use of mathematical problems which no algorithm can be used to solve.

A

The next two questions use a robot in a grid of squares. The robot is represented as a triangle, which is initially facing up, towards the top of the grid. The robot is moved according to the following instructions. Instruction Explanation MOVE_FORWARD() The robot moves one square forward in the direction it is facing. ROTATE_RIGHT() The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn). ROTATE_LEFT() The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn). REPEAT n TIMES The block of instructions contained between the braces { } is repeated n times. Consider the following program which uses commands from the pseudocode described above. REPEAT 4 TIMES { MOVE_FORWARD() MOVE_FORWARD() MOVE_FORWARD() ROTATE_RIGHT() MOVE_FORWARD() ROTATE_RIGHT() MOVE_FORWARD() ROTATE_RIGHT() } Which of the following images shows the path and ending location of the robot that will result from executing the code above. The starting location of the robot is shown as dotted triangle for cases where the robot does not start and end at the same location.

B (looks like a flower with 4 petals)

The various protocols in use on the internet are said to operate in layers in which the protocol(s) at each layer solve one problem related to networked communication, and higher layers are built on top of, and rely on, the lower layers to do their jobs. From the list provided choose the two (2) answers that correctly describe which internet protocol relies on the other. For example: if protocol A relies on protocol B, it means that A is a higher level protocol than B, and thus protocol B must exist and work properly in order for protocol A to do its job. Select two answers. A. TCP/IP relies on HTTP B. HTTP relies on TCP/IP C. DNS relies on TCP/IP D. TCP/IP relies on DNS

B,C

The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IETF are: A. An International coalition of government agencies who oversee the Internet in their countries. B. A collection of the leaders of the Tier 1 Internet service providers. C. A loosely organized collection of citizens and engineers. D. Political leaders and heads of state. E. There are no members. IETF is an "organization" in name only.

C

A coffee shop is considering accepting orders and payments through their phone app and have decided to use public key encryption to encrypt their customers' credit card information. Is this a secure form of payment? A. No, public key encryption allows the credit card information to be read by the public. B. No, the internet protocols are open standards and thus everything sent over the internet is sent "in the clear". C. Yes, public key encryption is built upon computationally hard problems that even powerful computers cannot easily solve. D. Yes, public key encryption is secure because it transmits credit card information in binary.

C

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? A. 2 times as many values can be represented. B. 32 times as many values can be represented. C. 2^32 times as many values can be represented. D. 32^2 times as many values can be represented.

C

Choose the answer that is NOT a feature of Public Key Cryptography: A. A key for decrypting is never made public B. Using public key guarantees that only the intended recipient can decrypt the message C. A Public Key database ensures 3rd party accountability of security D. Allows secure communication without establishing a *shared* encryption key ahead of time.

C

The figure represents a network of physically linked computers labeled A through F. A line between two computers indicates that the computers can communicate directly with each other. Any information sent between two computers that are not directly connected must go through at least one other computer. The weight or cost of sending information from one computer to another is indicated by the number above the line. For example, information can be sent directly between computers A, and B and will cost 5. Information sent between computers A and D must go through either computer C (with total cost 5), or through computer B (with total cost 8) Question: Computer A sends a packet intended to reach computer F. Along its path it arrives at Computer C. Which computer should Computer C forward the packet to in order to use the most cost effective path?

C

The image below shows an encoding for a black and white pixel image. The first two bytes of the data (circled in red) are used to encode the width and height of the image. What is the best term for this type of "data about the data"? A. megadata B. superdata C. metadata D. predata

C

What is a Distributed Denial of Service (DDoS) attack? A. A coordinated effort by a group to simultaneously attempt to gain entry to foreign government's servers or systems B. An effort by network engineers to focus all systems on catching a user or computer that has illegally gained access. C. An attempt to compromise a single target by flooding it with requests from multiple systems. D. An attempt to harass or extort all customers of one or more Internet Service Providers (ISPs).

C

What is one important naming convention of functions? A. A function name should indicate how long the function takes to run. B. Two functions with similar behavior should be given identical names to indicate the relationship between them. C. A function name should be as descriptive as possible to indicate what the function does. D. Function names should be organized alphabetically. E. The function name should begin with a number that indicates the order in which it should be executed.

C

What is the minimum number of bits you would need to encode the 26 letters of the alphabet plus a space - a total of 27 characters? A. 2 bits B. 3 bits C. 5 bits D. 6 bits

C

Which of the following is NOT true about functions in programming? A. Functions are reusable programming abstractions. B. Functions help reduce the complexity of writing and maintaining programs. C. Functions cannot make calls to other functions within the same program. D. Functions help break a problem into logical chunks. E. Once defined, a function can be called many times from different parts of a program.

C

Which of the following statements are true about routers and routing on the Internet. Choose two answers. A. Protocols ensure that a single path between two computers is established before sending packets over it. B. Routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. C. A packet traveling between two computers on the Internet may be rerouted many times along the way or even lost or "dropped". D. Routers act independently and route packets as they see fit.

C,D


संबंधित स्टडी सेट्स

Series 7 Top-off - Chapter 20 **copy**

View Set

CS 0007 - Introduction to Java - Exam 1

View Set

GST 222 - LECTURE 1 - CONCEPTUAL DEFINITIONS OF PEACE AND CONFLICT

View Set

AP Chemistry Chapter Three Review Questions

View Set

Chapter 46, Assessment of the Eye and Vision

View Set

IT 376 Exam 1 Review (HW1 & HW2)

View Set