AP Computer Science Review

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

A. 9 bits

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

B. Which customer most frequently purchases bread.

A bakery collects data on sales. Each sales record includes the date of the sale and some metadata about the items that were part of the sale. The data includes: the names of the items sold, the types of items sold, the number of each item sold, and the price of each item sold. Which of the following CANNOT be determined from the bakery's data set? A. The total income from the sales of the bakery received in the past month. B. Which customer most frequently purchases bread. C. The item bought in the highest quantity in the past week. D. Days when certain items sell the most.

C. To determine the topics that many users are posting about

A certain social media Web site allows users to post messages and to comment on other messages that have been posted. When a user posts a message, the message itself is considered data. In addition to the data, the site stores the following meta data. The time the message was posted The name of the user who posted the message The names of any users who comment on the message and the times the comments were made For which of the following goals would it be more useful to analyze the data instead of the metadata? A. To determine the users who post messages most frequently B. To determine the time of day that the site is most active C. To determine the topics that many users are posting about D. To determine which posts from a particular user have received the greatest number of comments

C. Yes, public key encryption is built upon computationally hard problems that even powerful computers cannot easily solve.

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 pubic. 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.

A. Add a bit to studentID to double the number of IDs that the database can represent.

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. Which is the most accurate description of how the school could modify the way studentID is represented in the database 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 databases 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. Add a bit to studentID to double the number of IDs that the database can represent. NOTE: Doubling the number of bits would obviously make room for more student IDs, but it's inaccurate to say that that doubles the number of possible IDs. If the number of bits went from 8 to 16, it's 256 TIMES AS MANY possible ids. 8 bits = 256 values and 16 bits = 65,536 IDs.

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. Which is the most accurate description of how the school could modify the way studentID is represented in the database 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 databases 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.

D. The frequency of a particular item occurring in a data set.

A programmer is writing a system that is intended to be able to store large amounts of personal data. As a programmer develops the data system, which of the following is the LEAST likely to impact the programmer's choice 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. The frequency of a particular item occurring in a data set.

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 the 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.

E. Alexander Graham Bell was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.

A programmer wrote an essay for his history class, and realized he has confused the names of Benjamin Franklin and Alexander Graham Bell. Instead of going through the whole paper and changing the names, he used the following incorrect algorithm in an attempt replace every occurrence of "Benjamin Franklin" with "Alexander Graham Bell" and vise versa: - First, change all occurrences of "Benjamin Franklin" to "apple" - Then, change all occurrences of "apple" to "Alexander Graham Bell". - Then, change all occurrences of "Alexander Graham Bell" to "Benjamin Franklin". Here is an example of one of the sentences from the paper: Alexander Graham Bell was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. Which of the following is the result of running the described incorrect algorithm on the sentence above? A. Benjamin Franklin was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors. B. apple was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. C. Alexander Graham Bell was born 141 years before apple, so he was never able to telephone his neighbors. D. Benjamin Franklin was born 141 years before Benjamin Franklin, so he was never able to telephone his neighbors. E. Alexander Graham Bell was born 141 years before Alexander Graham Bell, so he was never able to telephone his neighbors.

A. Lossy compression

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

D. Which websites are most frequently visited before and after school hours from a school computer.

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 example.com 1.5.1.8 11:05:29 news.com 1.1.5.1 11:06:13 sports. 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. Low bandwidth, low latency

A user clicks on a website, and it begins to load immediately, but it takes a long time to load completely and pictures appear slowly, one by one. Which of the following is demonstrated through this situation? A. High bandwidth, high latency B. Low bandwidth, high latency C. High bandwidth, low latency D. Low bandwidth, low latency

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

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. 2^32 times as many values can be represented. NOTE: Every time you add a single bit to a binary number, you multiply by 2 the number of numbers you can represent. So for example, a 2-bit number can represent 4 numbers (0 - 3), and a 3-bit number can represent 8 numbers (0 - 7). So if you're going from a 32-bit to a 64-bit number, you are multiplying the number of numbers you can represent by 2, 32 times, so 2^32 is the correct answer.

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. 2^32 times as many values can be represented.

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. 2^32 times as many values can be represented. NOTE: Every time you add a single bit to a binary number, you multiply by 2 the number of numbers you can represent. So for example, a 2-bit number can represent 4 numbers (0 - 3), and a 3-bit number can represent 8 numbers (0 - 7). So if you're going from a 32-bit to a 64-bit number, you are multiplying the number of numbers you can represent by 2, 32 times, so 2^32 is the correct answer.

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.

A. about.example.com

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. F00

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. F00 NOTE: The correct answer is F00. A single hex digit is used to represent a 4-bit sequence - since there are 16 possible 4-bit sequences and 16 different hex digits 0-F. So 3 hex digits represents 12 bits, and the first digit represents the intensity of Red in an RGB image.

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. 1,000 times

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

C. Do the movement patterns of the animal vary according to the weather?

Biologists often attach tracking collars to wild animals. For each animal, the following geolocation data is collected at frequent intervals. The time The date The location of the animal Which of the following questions about a particular animal could NOT be answered using only the data collected from the tracking collars? A. Approximately how many miles did the animal travel in one week? B. Does the animal travel in groups with other tracked animals? C. Do the movement patterns of the animal vary according to the weather? D. In what geographic locations does the animal typically travel?

C. A Public Key database ensures 3rd party

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.

B. a:4, b:8, c:8

Consider the code segment below: What are the values of a, b, and c after this code segment has been run? var a = 0; var b = 3; var c = 4; a = a+c; b = a+c; c = a+c; A. a:4, b:4, c:4 B. a:4, b:8, c:8 C. a:4, b:8, c:12 D. a:4, b:8, c:16 E. a:0, b:3, c:4

B. DEC: 13, BIN: 1110, HEX: F

Consider the following numbers given in Binary (BIN), Decimal (DEC), and Hexadecimal (HEX) representations: BIN: 1110 DEC: 13 HEX: F Which of the following lists the numbers in order from least to greatest? A. BIN: 1110, DEC: 13, HEX: F B. DEC: 13, BIN: 1110, HEX: F C. DEC: 13, HEX: F, BIN: 1110 D. HEX: F, DEC: 13, BIN: 1110

B. DEC: 13, BIN: 1110, HEX: F

Consider the following numbers given in Binary (BIN), Decimal (DEC), and Hexadecimal (HEX) representations: BIN: 1110 DEC: 13 HEX: F Which of the following lists the numbers in order from least to greatest? A. BIN: 1110, DEC: 13, HEX: F B. DEC: 13, BIN: 1110, HEX: F C. DEC: 13, HEX: F, BIN: 1110 D. HEX: F, DEC: 13, BIN: 1110

A. Symmetric

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. Symmetric NOTE: Symmetric Encryption: A scheme in which the key to encrypt data is the same as the key to decrypt. Asymmetric Encryption: Used in public key encryption, it is a scheme in which the key to encrypt data is different from the key to decrypt. Public Key: This is used prevalently on the web, it allows for secure messages to be sent between parties without having to agree on, or share, a secret key. It uses an asymmetric encryption scheme in which the encryption key is made public, but the decryption key is kept private. SSL: (Secure Sockets Layer) is the standard security technology for establishing an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browsers remain private and integral.

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. Loop

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)

B. Function(s)

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)

A. Loop

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)

B. Function(s)

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)

A. It asks a DNS server for the corresponding IP address.

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.

C. cartTotal = cartTotal +1;

Jasmine is writing a shopping app. She has created a variable to keep track of the number of items in the shopping cart. Every time someone clicks the "addItemButton", she would like the variable to increase by 1. var carTotal = 0; onEvent("addItemButton", "click", function() { //missing code console.log(carTotal); What code should Jasmine insert where it says <missing code> in order for her app to work? A. cart total = 1; B. cartTotal + 1; C. cartTotal = cartTotal +1; D. var cartTotal = cartTotal + 1; E. var cartTotal + 1;

D var temp = from; from = to; to = temp;

Jose is writing a reply function for a text messaging app. He'd like to swap the sender and receiver so that the value currently in variable From ends up as the value in To and To ends up in From Which of the following code segments will correctly swap the values as described? A. to = from; from = to; B. from = var temp; to = temp; from = to; C. var temp = from; from = to; to = from; D var temp = from; from = to; to = temp; E var temp = to; from = to; to = temp;

A. 9 MOD 8 B. 1 MOD 16

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. 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.

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.

D. kilobyte, gigabyte, terabyte

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

C. A loosely organized collection of citizens and engineers.

The Internet Engineering Task Force defines protocols and standards for how the Internet works. The members of IETF are: A. An international coalition of government agencies who oversee the Internet in their countries. B. A collection of leaders of the Tier 1 Internet service providers. C. A loosely organized collection of citizens and engineers. D. Political leaders and heads of state.

A. Lossless transformation

The colors of 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 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. Lossless transformation NOTE: The answer is "lossless" transformation because there is a computational process you can perform on the transformed data to recover the original (namely, subtract 20). The question is carefully formulated to ensure that this is true. This question is tricky for a few reasons: it is carefully formulated with starting assumptions and values that ensure the transformation is lossless. If you applied this transformation willy-nilly it might be lossless (see below). it applies the terms lossy and lossless outside the context they are usually presented (compression) because of the fact that the data is being transformed and overwritten, you might be tricked into thinking that the data is "lost". But the transformation itself is lossless because you can apply a computational process to the transformed data to recover every bit of the original information. It would be "lossy" if the transformation did something that would not let you recover every bit. For example: If the question stated that you add 200 to each RGB channel, it might be lossy, because if, say, one of the RGB values was (75, 57, 99), adding 200 to each would max out the values at 255 - since an RGB value cannot be greater than 255 - the resulting transformation would be the RGB value (255, 255, 255). Reversing the process, subtracting 200 from each of the transformed values does not restore the original. Since there is no process or computation you can perform on the transformed data to recover the original, it is "lossy".

The colors of 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 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

C. V

The next question refers to hexadecimal which is a base-16 number system - a number system that uses one of 16 possible digits for each place value. 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. Decimal ASCII 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y 90 Z A. A B. L C. V D. Y

C. V NOTE: In order to calculate the value of the base-16 number 56, it is 5*16^1 + 6*16^0 = 86, which maps to 'V' in the table

The next question refers to hexadecimal which is a base-16 number system - a number system that uses one of 16 possible digits for each place value. 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. Decimal ASCII 80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W 88 X 89 Y 90 Z A. A B. L C. V D. Y

D. There is a limit to the number of things that can be represented in binary data at which point switching to hexadecimal representation is necessary.

The next questions refers to the hexidecimal (base 16) number system: Number bases, including binary, decimal, and hexadecimal, are 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. Hexadecimal is used to represent digital data because hexadecimal representation uses only 1 digit to represent groups of 4 binary digits. C. Binary can be used to represent more complex, higher level abstractions, including but not limited to numbers, characters, and colors. D. There is a limit to the number of things that can be represented in binary data at which point switching to hexadecimal representation is necessary.

B. HTTP relies on TCP/IP C. DNS relies on TCP/IP

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

D. 32-bit addresses could not ensure that every internet-connected device can receive a unique IP address.

The world is currently in a transition to use 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.

B. Lossless compression

To uncompress 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

C. When the problem cannot be solved in a reasonable time and an approximate solution is acceptable.

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. An attempt to compromise a single target by flooding it with requests from multiple systems.

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).

D. value is: 4

What is displayed by the console.log statement after the following code segment executes? 1 var a = 3; 2 var b = 6; 3 var c = 10; 4 a = b / a; 5 b = c - a; 6 c = b / a; 7 console.log("value is: "+c); A. value is: 2 B. value is: 2.3333333 C. value is: 3 D. value is: 4 E. value is: c

C. A function name should be as descriptive as possible to indicate what the function does.

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.

B. 1010

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

D. It's easier, cheaper, and more reliable to build machines and devices that only have to distinguish between binary states.

What is the best explanation for digital data is represented in computers in binary? A. The binary number system is the only number system flexible enough to allow for representing data other than numbers. B. As a consequence of history: early pioneers of computing were making secret codes in binary, and this simply evolved into modern computing. C. It's impossible to build a computer machine that uses anything but binary to represent numbers. D. It's easier, cheaper, and more reliable to build machines and devices that only have to distinguish between binary states.

C. metadata

What is the best term for "data about the data" A. megadata B. superdata C. metadata D. predata

C. 5 bits

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

E. Error. Unknown Identifier: x 13.

What is the output to the console after the following code segment is executed? 1 fiveMore(); 2 function fiveMore(){ 3 var x = 5; 4 } 5 var y = 3 + x; 6 console.log(y); A. -2 B. 3 C. 5 D. 8 E. Error. Unknown Identifier: x

D. 13

What is the output to the console after the following code segment is executed? 1 var x = 10; 2 increase(); 3 x = x+3; 4 console.log(x); 5 function increase(){ 6 var x = 5; 7 } A. 5 B. 8 C. 10 D. 13 E. Error. Cannot make a new variable x inside function increase()

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.

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.

B. Low level protocols can provide functionality to high level protocols without revealing the details of how this is accomplished.

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. Display the value of variables at various points during the program. C. Ask a friend or collaborator to look over the code segment to see if they are able to find any errors.

Which of the following are actions a programmer could take when debugging a segment of code that would most likely lead to finding a problem and fixing it? (choose two) A. Change the names of variables within the program and run the program again. B. Display the value of variables at various points during the program. C. Ask a friend or collaborator to look over the code segment to see if they are able to find any errors. D. Delete the code and re-type it to make sure there were no spelling errors and that it was written correctly.

A. An element with a unique ID must always have an event handler associated with it.

Which of the following is FALSE about element IDs? A. An element with a unique ID must always have an event handler associated with it. B. Any element that needs to be triggered by onEvent must have a unique ID. C. Two or more onEvent calls may reference the same ID. D. While not a requirement, IDs should be meaningful and descriptive. E. IDs allow a programmer to reference interface elements within their code.

A. Event-driven programs do not implement algorithms.

Which of the following is FALSE about event-driven programs? A. Event-driven programs do not implement algorithms. B. Some portions of an event-driven program may never execute while the program is running. C. An event-driven program is written to respond to specified events by executing a block of code or function associated with the event. D. The order in which an event-driven program will run cannot always be known ahead of time. E. Event-driven programs can be run multiple times with different outcomes, based on user interactions.

B. TCP guarantees that no packets are ever dropped.

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.

C. Functions cannot make calls to other functions within the same program.

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.

D. There are trade-offs involved in choosing a compression technique for storing a transmitting data.

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 a transmitting data.

C. Moore's Law is the observation that computing power tends to double every two years.

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. Moore's Law is the observation that computing power tends to double every two years. NOTE: Definition of Moore's Law: A predication made by Gordon Moore in 1965 that computing power will double every 1.5-2 years, it has remained more or less true ever since.

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.

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

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.

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.

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.

A. Public key encryption is an encryption method which relies on separate keys for encrypting and decrypting information.

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.

E. Two functions in a single program can have different names but contain identical code.

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.

B. Parameters allow for more flexible, generalized behaviors in functions.

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.


Set pelajaran terkait

apes unit 9 college board practice test answers

View Set

MKT 205-010 Principles of Marketing Final Exam Part 3

View Set

Structural Family Therapy (Salvador Minuchin)

View Set

Chapters 1, 4, 7, 13, 15 -Pathophysiology Midterm Review

View Set

Funds Quiz 2- IV, Blood transfusion

View Set