Set #1¶
The following questions make up Set #1 of the Practice Exam Questions. The questions resemble, both in format and substance, what you might see on the AP CS Principles exam. You should finish these questions within 17 minutes to satisfy the time constraints of the AP exam. You may refer to the official AP CS Reference Sheet during the exam, provided by the College Board, which can be found here.
Click the “Start” button when you are ready to begin the exam. Click the “Pause” button to pause the exam (you will not be able to see the questions when the exam is paused). It will show how much time you have used, but you have unlimited time. Click on the “Finish Exam” button at the end when you are done. The number correct, number wrong, and number skipped will be displayed at the bottom of the page. Feedback for each answer will also be shown as well as your answer.
You will not be able to change your answers after you hit the “Finish Exam” button.
- I. and III. only
- Correct
- I. and II. only
- Incorrect
- II. and III. only
- Incorrect
- I., II. and III.
- Incorrect
- Abstraction requires users to understand the low-level details of a system.
- Incorrect
- Abstraction reduces information and detail to facilitate focus on relevant concepts.
- Correct
- Abstraction increases the complexity of the software system.
- Incorrect
- Abstraction compresses a program file to reduce file size.
- Incorrect
- Yes, the code correctly switches the values of 'a' and 'b'.
- Incorrect
- No, but it will work correctly if statements 1. and 3. are switched.
- Incorrect
- No, but it will work correctly if statements 2. and 3. are switched.
- Correct
- No, but it will work correctly if statements 1. and 2. are switched.
- Incorrect
- X = 155, Y = 1555
- Incorrect
- X = 20, Y = 20
- Incorrect
- X = 15, Y = 5
- Incorrect
- X = 20, Y = 25
- Correct
- The baby duck picture appears as intended.
- Correct
- The baby duck picture appears as 4 out of order images.
- Incorrect
- The baby duck picture is distorted.
- Incorrect
- The baby duck picture won’t load on the user’s smartphone.
- Incorrect
- Cloud Computing
- Correct
- Global Positioning System
- Incorrect
- Short Message Service
- Incorrect
- Data Mining
- Incorrect
- a ≥ c and c ≥ b
- Correct
- a ≥ c and b ≥ c
- Incorrect
- c ≥ a and c ≥ b
- Incorrect
- c ≥ b and c ≥ a
- Incorrect
- 4
- Incorrect
- 8
- Incorrect
- 16
- Correct
- 32
- Incorrect
- Sorting students by grade
- Incorrect
- Deleting a student’s record
- Incorrect
- Searching for a student’s name
- Incorrect
- Adding bonus points to grades of all students
- Correct
- Because hexadecimal is a lower level of abstraction than binary.
- Incorrect
- Because hexadecimal can be represented with fewer total digits than binary.
- Correct
- Because numbers greater than 1 must be used for certain forms of digital data.
- Incorrect
- Because hexadecimal is easier to convert to decimal form.
- Incorrect
24-1-1: Which of the following statements are true regarding compressing files?
I. If lossless compression is applied, every single bit of data that was originally in the file remains after the file is uncompressed.
II. No matter what compression technique is used, once a data file is compressed, it cannot be restored to its original state.
III. The amount of data reduction possible using lossy compression is often much higher than through lossless techniques.
24-1-2: Which of the following statements about abstraction is true?
24-1-3: A programmer is writing code to switch the values of two integer variables, namely a
and b
, using a temporary integer variable, temp
. This is the pseudo-code that the programmer has come up with:
temp ← a # statement 1.
b ← temp # statement 2.
a ← b # statement 3.
Will the pseudo-code correctly perform the required task (assume that a
and b
are never numerically equal)?
24-1-4: What is the final value of the integers X
and Y
after the following statements are executed?
X ← 15
Y ← 5
X ← X + Y
Y ← X + Y
24-1-5: A user’s smartphone makes a request to a server for 4 packets that represent the image of a baby duck. The server sends the 4 packets but they arrive at the user’s smartphone out of order. How does the smartphone interpret the packets that form the image?
24-1-6: Which of the following technologies allows its users to store, manage and access files remotely over the Internet?
24-1-7: Consider the following incomplete pseudo-code to print the largest of three integer variables, namely a
, b
and c
:
IF (a ≥ b)
{
IF (*incomplete_1*)
{
DISPLAY(a)
}
ELSE
{
DISPLAY(c)
}
}
ELSE
{
IF (*incomplete_2*)
{
DISPLAY(c)
}
ELSE
{
DISPLAY(b)
}
}
Which of the following options can be substituted for incomplete_1 and incomplete_2, respectively, for the code to work as intended?
24-1-8: Trace the value of an integer variable n
in the following code.
i ← 1
n ← 2
REPEAT until i = 4
{
n ← n * 2
i ← i + 1
}
What is the value of n
after the above code executes?
24-1-9: A professor uses an automated computer system to manage the student records of his classes. The time the system takes to perform various tasks for different class sizes is shown in the table below:
Task ↓ Size → |
Small class (25 students) |
Medium class (50 students) |
Large class (100 students) |
---|---|---|---|
Sorting students by grade |
10 seconds |
40 seconds |
160 seconds |
Deleting a student’s record |
2 seconds |
4 seconds |
8 seconds |
Searching for a student’s name |
1 second |
2 seconds |
4 seconds |
Adding bonus points to grades of all students |
3 seconds |
6 seconds |
9 seconds |
Based on the information in the table, which of the following tasks is likely to take the least amount of time if the computer system is used for a class of 400 students?
24-1-10: Why is digital data often represented in hexadecimal as opposed to binary?