FIRST PUBLISH OCTOBER 2024
AP Computer Science Principles Exam
Questions with Correct Answers
Consider the following code segment, which uses the variables r, s, and t.
r <-- 1
s <-- 2
t <-- 3
r <-- s
s <-- t
DISPLAY (r)
DISPLAY (s)
What is displayed as a result of running the code segment?
(A) 1 1
(B) 1 2
Page 1/15
, ©EMILLECT 2024/2025 ACADEMIC YEAR. ALL RIGHTS RESERVED
FIRST PUBLISH OCTOBER 2024
(C) 2 3
(D) 3 2 - ANSWER✔✔-(C)
Which of the following is a true statement about product documentation?
(A) Program documentation should not be changed after it is first written.
(B) Program documentation is only needed for programs in development; it is not needed after a
program is completed.
(C) Program documentation is useful when programmers collaborate but not when a programmer works
individually on a project.
(D) Program documentation is useful during initial program development and also when modifications
are made to existing programs. - ANSWER✔✔-(D)
Which of the following best explains what happens when a new device is connected to the Internet?
(A) A device driver is assigned to the device.
(B) An Internet Protocol (IP) address is assigned to the device.
(C) A packet number is assigned to the device.
(D) A Web site is assigned to the device. - ANSWER✔✔-(B)
Page 2/15