AP CSP FINAL

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/96

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

97 Terms

1
New cards

What number will be output by the console.log command on line 7?

100

<p>100</p>
2
New cards

What text will be output by the program?

Less than 30

<p>Less than 30</p>
3
New cards

"You win!" never displays. What line is responsible for this error?

3

<p>3</p>
4
New cards

This function chooses the screen to display based on the score. What is the correct way to call this function?

checkWin

<p>checkWin</p>
5
New cards

Why are parameters useful when programming?

Parameters allow for more flexible, generalized behaviors in functions.

6
New cards

Which of the following is true of functions?

Functions can help remove repeated code from a program

7
New cards

What is stored in studentScores after running the program code?

[82, 0, 0, 97, 91]

<p>[82, 0, 0, 97, 91]</p>
8
New cards

A school is developing a program to keep track of information about students and their class schedules. In which of the following instances would a data abstraction be most helpful?

The program includes individual variables to store the names of each student rather than a single list of students.

9
New cards

Your computer uses 4 bits to represent decimal numbers (0, 1, 2, 3 and so on) in binary. What is the SMALLEST number for which an overflow error occur?

16

10
New cards

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

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

B)When the problem cannot be solved in a reasonable time and an exact solution is needed

C)When the problem can be solved in a reasonable time and an exact solution is needed

D)When the problem can be solved in a reasonable time and an approximate solution is acceptable

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

11
New cards

What best describes how computing devices represent information?

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

12
New cards

Which of the following is NOT true of how computers represent complex information?

Abstraction helps represent complex information by surfacing complexity that might otherwise be hidden

13
New cards

When visiting a museum Lian takes a photo of a painting with a smartphone which stores the photo as an image file. Which of the following best describes the differences between the painting itself and the photo of the painting stored on the smartphone?

The photo is a digital representation of the analog painting

14
New cards

The following is true of how computers represent numbers

When a fixed number of bits some numbers are too large to represent in a computer which will lead to the overflow errors

15
New cards

Convert the binary (base-2) number 1001 to decimal (base-10)

9

16
New cards

convert the decimal (base-10) number 20 to binary (base-2)

10100

17
New cards

Which of the following binary (base-2) numbers is LARGEST?

11000000

18
New cards

How many of the total numbers can be represented with an 8-bit binary (base-2) system?

256

19
New cards

Which of the following is true of lossy and lossless compression algorithms?

Lossy compression algorithms are typically better than lossless compression algorithms at reducing the number of bits needed to represent a piece of data

20
New cards

Jorge is sending a large image file as part of a shared classroom project. Which of the following is most likely true if Jorge opts to compress the image before sending it?

The image will require fewer bits in order to be represented.

21
New cards

The image will require fewer bits in order to be represented.

The following statement is true of intellectual property

Creative commons enables content creators to freely distribute their otherwise copyrighted work

22
New cards

Lucy is completing a project as part of a science class using materials she found online. The following is MOST LIKELY to lead to legal consequences.

Using images posted online by another student without permission or citation.

23
New cards

Ryan is designing an app that needs to quickly send low quality photos between users. Most smartphones take much higher quality photos than Ryan needs for his app. The following is the type of compression Ryan should choose and why.

Lossy compression since it typically results in smaller data sizes.

24
New cards

Arman takes a picture with his smartphone which he subsequently posts online. Beatrice finds the picture online and posts a copy of it on her website with an attached Creative Commons license. The following best describes who owns the photos

Arman owns the photos because he was the original creator and did not license the work.

25
New cards

Which of the following best describes the protocols used on the Internet?

D. The protocols of the Internet are open and used by all devices connected to the network

26
New cards

Jesse purchases a new smartphone and is immediately able to use it to send a photo over the Internet to a friend who lives in a different country. Which of the following is NOT necessary to make this possible?

B. A single direct connection is established between any two devices connected to the Internet

27
New cards

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

A. The Internet protocols are changed every year to adapt to the new devices that have been connected to the network

B. While the number of devices connected to the Internet has grown, the network itself has not grown

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

D. The protocols of the Internet are no longer necessary thanks to the large number of devices now connected to the network

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

28
New cards

Which of the following is true of how packets are sent through the Internet?

B. Packet metadata is used to route and reassemble information traveling through the Internet

29
New cards

Emilee is watching an online video. The video is being sent to her laptop by a server over the Internet which splits the video into packets and sends them in the order they appear in the video. Which of the following is true about how the packets will arrive at her computer?

D. The packets may arrive out of order

30
New cards

Which of the following best describes the purpose of an IP address?

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

31
New cards

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

A. Transmission Control Protocol (TCP)

32
New cards

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

D. HyperText Transfer Protocol (HTTP)

33
New cards

Two devices are connected to the Internet and communicating with one another. A squirrel chews through one of the wires in the network that is currently being used by the devices to communicate. The network immediately begins using a different path through the network and communication continues as normal.This situation best exemplifies which principle?

A. fault-tolerance

34
New cards

An Internet Service Provider (ISP) is a company that builds routers and wired connections that allow individuals to access the Internet. An ISP is considering adding additional redundant connections to its network. Which of the following best describes why the company would choose to do so?

C. Redundant networks are more reliable

35
New cards

Which of the following situations is most likely to cause issues arising from the digital divide?

A. A state makes voter registration forms available only by visiting a government website

36
New cards

Which of the following is MOST likely to be an outcome of the digital divide?

B. People from some racial or ethnic groups have unequal access to computing technology.

37
New cards

Which of the following best explains how messages are typically transmitted over the Internet?

B. The message is broken into packets. The packets can be received in any order and still be reassembled by the recipient's device.

38
New cards

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

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

39
New cards

Which of the following best describes the relationship between the World Wide Web and the Internet?

C. The World Wide Web is a system of linked pages, programs, and files that is accessed via a network called the Internet.

40
New cards

Which of the following best explains how fault tolerance in a network is achieved?

B. By providing multiple paths between devices, enabling routing to occur even in the presence of a failed component

41
New cards

Which of the following best explains how the Internet is a fault-tolerant system?

B. The Internet is fault-tolerant because there are usually multiple paths between devices, allowing messages to sometimes be sent even when parts of the network fail

42
New cards

Which of the following is a primary benefit of making a computing system fault-tolerant?

A.If one component of the system fails, users of the system can often still access it.

43
New cards

Which of the following actions is most likely to help reduce the digital divide?

B. Deploying satellites and other infrastructure to provide inexpensive Internet access to remote areas of Earth

44
New cards

Which of the following is LEAST likely to be a contributing factor to the digital divide?

C. Some parents prefer to limit the amount of time their children spend using computing devices or the Internet.

45
New cards

Which of the following actions is most likely to be effective in reducing the digital divide at a local level?

C. Providing free community access to computers at schools, libraries, and community centers

46
New cards

In which of the following stages of the development process is a team MOST likely to interview a potential user of an app?

A. investigating and reflecting

47
New cards

Which of the following best describes the purpose of a design specification?

C. Describing the requirements for how a program will work or users will interact with it

48
New cards

What will the "background-color" of the "topButton" be when the program is finished running?

C. blue

49
New cards

If the user does NOT click the button what color will "topButton" be when this program finishes running?

B. blue

50
New cards

The following program is run. Then the user clicks the "topButton" button ONCE. What will be displayed in the console?

C.catdogbird

51
New cards

The following program is run. Then the user clicks the "bottomButton" ONCE and then clicks the "topButton" ONCE. What will be displayed in the console?

D.cccbbbaaa

52
New cards

The following program is run. Then the user clicks the "bottomButton" TWO TIMES. What will be displayed in the console?

B.bbbdddcccccc

53
New cards

Which line of code in this program is MOST likely to result in an error?

B. Line 2

<p>B. Line 2</p>
54
New cards

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

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

55
New cards

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

A. Comments help the computer decide whether certain components

56
New cards

What number will be output by the console.log command on line 5?

16

<p>16</p>
57
New cards

What number will be output by the console.log command on line 5??

35

<p>35</p>
58
New cards

What text will be output by the program??

Output D

<p>Output D</p>
59
New cards

What will be the order of letters printed to the console when this program is run?

abcbc

<p>abcbc</p>
60
New cards

When this function is called, the smaller of two numbers is displayed. What Boolean expression would not work in line 12 in order to accomplish this goal?

num1 == num2

<p>num1 == num2</p>
61
New cards

There is repeated code in these onEvent blocks. Choose the correct code for the updateScreen() function which would be called in each of the onEvent blocks.

function updateScreen() {setText("counter_label", "counter");if (counter == 0) {setProperty("counter_label", "font-size", 24);}}

62
New cards

A movie theater charges different ticket prices based on a customer's age. The prices are shown in the table below.The customer's age is stored in the variable age and the price is stored in the variable price. Which piece of code will correctly decide the price for each ticket.

if (age >= 65) {price = 6;} else if ((age > 12)) {price = 8;} else {price = 5;}

63
New cards

A museum charges different prices based on the day of the week and age of the visitor. The pricing rules are shown below.On Tuesday and Thursday children 10 and under get in free ($ 0).For all other days and ages the cost is ten dollars ($ 10).The visitor's age is stored in the variable age, the day of the week is stored in a variable day, and the price in dollars is stored in the variable price. Which piece of code will correctly decide the price for each ticket.

if ((day == "Tuesday" || day == "Thursday") && (age <= 10)){price = 0;} else {price = $10;}

64
New cards

What will the value of the variable bags be at the end of the flowchart shown here?

2

<p>2</p>
65
New cards

Choose the correct definition for Conditional Statement

affects the sequential flow of control by executing different statements based on the value of a Boolean expression

66
New cards

Which of the following is true of functions??

Functions can help remove repeated code from a program

67
New cards

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 computerB. Compared to the number of words in a natural language, the number of defined words in a programming language is very small.

68
New cards

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

picture

<p>picture</p>
69
New cards

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 3 and Line 4

70
New cards

Which of the following is NOT true about functions in programming?

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

71
New cards

What is one important naming convention of functions?

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

72
New cards

Which one of the following statements about functions is TRUE?

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

73
New cards

Which of the following will call the function drawStar?

B. drawStar();

74
New cards

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 taskDrawing out the letters of a word

Function

75
New cards

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:

Loop

76
New cards

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.

Loop

77
New cards

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.

Function

78
New cards

Why are parameters useful when programming??

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

79
New cards

What is the most likely outcome of running the code shown at the right?

What is the most likely outcome of running the code shown at the right?

80
New cards

When programmers work together, what is an example of how abstraction in programming can promote collaboration?

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.

81
New cards

Which of the following images represents the most likely output produced by the code segment given below?

B. Function with squares on top of each other and turtle is facing left. (Less complicated pic)

82
New cards

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

Through the use of abstraction, a programmer can take a large idea and break it down into smaller pieces. In top down design, the programmer can create one function made up of smaller functions, but after creating the smaller functions, he/she no longer needs to know how they work, just that they do work.

83
New cards

A photographer stores digital photographs on her computer. In this case the photographs are considered the data. Each photograph also includes multiple pieces of metadata including:

c. Filter photos to those taken of buildings

84
New cards

Due to computer error, the Time metadata for all of the photographs is accidentally set to the same time of day. The other pieces of metadata and the data itself are not affected by the error. Which of the following is MOST likely to be the result of this problem?

c. The photographer will not be able to filter to photographs taken in the morning

85
New cards

Which column of data might be able to be visualized or analyzed but first would need to be cleaned?

b. How Long

86
New cards

A restaurant is interested in learning about the food preferences of people living nearby to the restaurant and intends to use survey data to help decide which new items to add to the menu. Which of the following is LEAST likely to be part of the process used to analyze the data?

a. Cleaning a data visualization to remove unwanted patterns

87
New cards

The bank intends to develop the algorithm using machine learning techniques. The algorithm will be trained using data from past loan decisions made by human bankers.Which of the following best describes whether this algorithm will include bias?

c. The algorithm will likely reflect the human biases in the data used to train it

88
New cards

The next three questions all refer to the same dataset described below.A school is conducting a survey of students to learn more about how they get to school. Students were asked how they travel to school, how long it takes them to get to school, what time they arrive at school, and for a description of their most significant challenges when traveling to school. Several rows of the data collected are shown in the table below.Which column is data will likely be most difficult to visualize or analyze?

d. Biggest Challenges

89
New cards

Which information could likely NOT be found with the data collected?answer choicesa. Whether students who are new to the school take longer to get to school than other students

a. Whether students who are new to the school take longer to get to school than other students

90
New cards

The chart above shows the frequency of searches for the words "pencil" and "pen" over a 5 year period. Which of the following is the best interpretation of the chart above?

d. At any point in time there are typically more people searching for the word "pen" than "pencil"

91
New cards

The mayor of a city is interested in learning what goals are most important for residents of the city. Members of her staff visit one of the many neighborhoods in the city and ask 20 residents to fill out a survey. The mayor is concerned that the survey may be biased and not accurately reflect the overall interests in her town. Which of the following strategies is MOST likely to address concerns about the data being biased or inaccurate

c. Visiting multiple new neighborhoods to collect more survey responses

92
New cards

In which of the following situations would parallel systems MOST likely be used to help analyze data?

c. Data analysis involving large datasets

93
New cards

The next two questions refer to the following chart.The chart below has a single point for every breed of dog. Each point indicates the maximum weight of that breed and the maximum number of years that breed of dog lives to.Which of the following conclusions is BEST supported by the scatter plot?

a. Dog breeds with a higher maximum weight tend to have shorter maximum lifespans

94
New cards

Which of the following conclusions is BEST supported by the scatter plot?answer choicesa. Most dogs breeds have a maximum weight of 100 lbs or moreb. Most dog breeds have a maximum life span of 10 or fewer yearsc. All dog breeds that weigh less than 50 pounds have a maximum lifespan of more than 10 yearsd. No dog breeds that weigh more than 150 pounds are expected to live more than 10 years.

c. All dog breeds that weigh less than 50 pounds have a maximum lifespan of more than 10 years

95
New cards

The histogram chart below has a single bar for every state in the United States. Each state is placed in a bucket, or range, based on its area in square miles.Which of the following conclusions is BEST supported by the histogram chart?

d. The most common size of states is between 50,000 and 100,000 square miles

96
New cards

A researcher is interested in learning more about the different kinds of plants growing in different areas of the state she lives in. The researcher creates an app that allows residents of the town to photograph plants in their area using a smartphone and record date, time, and location of the photograph. Afterwards the researcher will analyze the data to try to determine where different kinds of plants grow in the state.Which of the following does this situation best demonstrate?

a. Citizen science

97
New cards

A town decides to publicize data it has collected about electricity usage around the city. The data is freely available for all to use and analyze in the hopes that it is possible to identify more efficient energy usage strategies.Which of the following does this situation best demonstrate?

c. Open Data