AP Computer Science Principles Pluchino (1 - 25)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

14. Imagine you are playing an online game with your friends. You are at a crucial stage in the basketball game and need just one more free throw to win the game. You see the entire complex scene display quickly. You aim at the hoop to shoot your free throw. You click the shoot button but there is a momentary freeze on your screen only to discover that you have lost the game. What is demonstrated by this situation?

(A) High bandwidth, high latency

11. 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? I. Using the simulation software can save the company money because it allows them to test building materials for safety without purchasing physical materials. II. Using the simulation software will perfectly predict what will happen in the event of an earthquake. III. Using the simulation software can help ensure the safety of the building during an earthquake without endangering people.

(A) I only

9. Which of the following can be represented by a sequence of 3 bits? I. The seven days of the week II. Between zero and eight pints of ice cream III. The nine innings in a standard baseball game

(A) I only

12. 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? For this question select TWO correct answers

(A) Look over all the cards to find the smallest one, and move it to the leftmost position. (C) 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.

6. What is a disadvantage of the open standard of Internet addressing and routing? Select two answers.

(A) censorship (B) possibility of denial of service attacks

24. 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 inputs A and B?

(B) At least one input must be true

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

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

21. Consider the following algorithms to store a color digital image. Which algorithms are examples of "lossy" compression? Select two answers:

(B) 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. (D) The algorithm translates a color image into a grayscale version of the color original storing only averages of the data used to store the original colors in the picture.

23. Consider the following program that is intended to calculate the sum of all items in a list: What will be the output printed if list ←[0, 5, -3, 4]?

(C) 4

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

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

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

(C) An algorithm to find the name stored at the end of a list

4. You decide you are going to take your internet privacy seriously. Which of the following action poses the greatest risk to your internet privacy?

(C) Encrypting your files and sharing your private key to ensure others who you choose to share files with can read them.

15. The Domain Name System (DNS) is designed to I. Allow for nested domain naming (e.g., digitalportfolio.collegeboard.org ) II. Allow for centralized access and administration III. Use cache and redundant servers for quick matching of IP addresses to domain names IV. Use a static database for matching IP address to domain names

(C) I and III only

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

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

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

(C) II and III

16. The figure below shows a circuit composed of two logic gates. The output of the circuit is true.

(C) Input A can be either true or false if Input B is true

17. A high school surveys all of its 1,750 students to determine the average number of hours U.S. high school students sleep per night. Which of the following is a true statement?

(C) The high school cannot draw meaningful conclusions from this data because the sample size is too small.

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

(D) 1 0 2

7. If Alice wishes to send Bob an encrypted message using public-key encryption, she should encrypt her message with ________________,

(D) Bob's public key

19. 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 total DISPLAY 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?

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

10. Which type of chart would best display the individual data from 1,000 individuals' daily time spent in social media?

(D) Scatter Plot

20. A student draws a gorgeous digital image on her school computer. She decides she wants to show her brother, so she saves it and later downloads the image onto her home computer. When she opens and resizes the image at home, the quality is noticeably inferior to the original she saved. Which of the following is a reasonable explanation for the reduced quality?

(D) The process she used to save the image utilized a "lossy" compression algorithm.

1. What value of A would make the output of the logic circuit false?

(D) There is no value of A such that the output of the logic circuit will be false

5. 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. Example: before and after a call to swap (list, 2, 3) on the list shown below The function header is defined below. Choose the three lines of code that will perform the swap correctly. procedure swap (list, x, y) { <MISSING CODE> }

(D) var temp ← list[y]; list[y] ← list[x]; list[x] ← temp;

3. In the process of digging, a landscaping company cuts a fiber line. Transmission of Internet traffic is still possible through additional pathways that provide alternate routes between the source and destination. The additional pathways describe a concept known as:

D) redundancy


Kaugnay na mga set ng pag-aaral

Science Quiz 1 Module 1 (content)

View Set

ACC-120 Prin of Financial Accounting

View Set

Biliary tract and upper gastrointestinal system; CH 14

View Set

Section 7 - Project Quality Management

View Set

Nu 230 therapeutics Chapter 32: Fluid, Electrolytes, and Acid-Base

View Set