AP CSP Sample Exam Questions - Part 2

AP CSP Sample Exam Questions - Part 2

10th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Searching Technique -Linear Search Quiz1

Searching Technique -Linear Search Quiz1

12th Grade

10 Qs

Computational Thinking

Computational Thinking

12th Grade

11 Qs

2.1.3 Search Recap

2.1.3 Search Recap

11th Grade

12 Qs

AP CSP BI 3

AP CSP BI 3

9th - 12th Grade

13 Qs

AP CSP Exam Review: Big Idea 3

AP CSP Exam Review: Big Idea 3

8th - 10th Grade

15 Qs

Introduction to Programming

Introduction to Programming

2nd - 10th Grade

10 Qs

Linear and Binary Search Quiz

Linear and Binary Search Quiz

12th Grade

15 Qs

2.6 - Compression

2.6 - Compression

9th - 10th Grade

10 Qs

AP CSP Sample Exam Questions - Part 2

AP CSP Sample Exam Questions - Part 2

Assessment

Quiz

Computers

10th - 12th Grade

Hard

Created by

Eileen Fallon

Used 98+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

13. There are 32 students standing in a classroom. Two different algorithms are given for finding

the average height of the students.

Algorithm A

Step 1: All students stand.

Step 2: A randomly selected student writes his or her height on a card and is seated.

Step 3: A randomly selected standing student adds his or her height to the value on the card, records the new value on the card, and is seated. The previous value on the card is erased.

Step 4: Repeat step 3 until no students remain standing.

Step 5: The sum on the card is divided by 32. The result is given to the teacher.

Algorithm B

Step 1: All students stand.

Step 2: Each student is given a card. Each student writes his or her height on the card.

Step 3: Standing students form random pairs at the same time. Each pair adds the numbers written on their cards and writes the result on one student’s card; the other student is seated. The previous value on the card is erased.

Step 4: Repeat step 3 until one student remains standing.

Step 5: The sum on the last student’s card is divided by 32. The result is given to the teacher.

Which of the following statements is true?

(A) Algorithm A always calculates the correct average, but Algorithm B does not.

(B) Algorithm B always calculates the correct average, but Algorithm A does not.

(C) Both Algorithm A and Algorithm B always calculate the correct average.

(D) Neither Algorithm A nor Algorithm B calculates the correct average.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

14. The figure shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region.

Consider the procedure MoveAndTurn shown. Which of the following code segments will move the robot to the gray square?

Media Image
Media Image
Media Image
Media Image

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

16. A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session.

Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions.


The following code segment is intended to create lunchList, which is initially empty.

It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise.


FOR EACH child IN morningList

{

<MISSING CODE>

}


Which of the following could replace <MISSING CODE> so that the code segment works as intended?

(A)

IF (IsFound (afternoonList, child))

{

APPEND (lunchList, child)

}

(B)

IF (IsFound (lunchList, child))

{

APPEND (afternoonList, child)

}

(C)

IF (IsFound (morningList, child))

{

APPEND (lunchList, child)

}

(D)

IF ((IsFound (morningList, child)) OR

(IsFound (afternoonList, child)))

{

APPEND (lunchList, child)

}

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

17. Consider the program code shown.

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

(A) The number 0 is displayed.

(B) The number 6 is displayed.

(C) The number 10 is displayed.

(D) Nothing is displayed; the program results in an infinite loop.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

19. An office building has two floors. A computer program is used to control an elevator that travels between the two floors. Physical sensors are used to set Boolean variables as shown in the table.

The elevator moves when the door is closed and the elevator is called to the floor that it is not currently on. Which of the following Boolean expressions can be used in a selection statement to cause the elevator to move?

(A) (onFloor1 AND callTo2) AND (onFloor2 AND callTo1)

(B) (onFloor1 AND callTo2) OR (onFloor2 AND callTo1)

(C) (onFloor1 OR callTo2) AND (onFloor2 OR callTo1)

(D) (onFloor1 OR callTo2) OR (onFloor2 OR callTo1)

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?