Worksheets2025-2026 AP CSP Midterm Exam
Total questions: 50
Worksheet time: 25mins
Which of the following best describes an algorithm?
A sequence of steps used to complete a task
A variable that stores numerical information
A block of code that repeats infinitely
A diagram used only for debugging
A student writes pseudocode before coding. What is the purpose of pseudocode?
To verify syntax before running a program
To express program ideas in a language-agnostic way
To store variables and data values
To automatically convert code into flowcharts
Which situation demonstrates sequencing?
A loop that repeats 10 times
A program choosing between two branches
A series of instructions executed in order
An event triggered by a mouse click
Consider the code segment: x = 5 x = x + 3 What is the value of x?
3
5
8
15
A conditional is used in a program to:
Organize data into a list
Provide user input
Select different actions based on a Boolean expression
Repeat a block of code until stopped
What is the value of count after this code runs? count = 0 REPEAT 3 TIMES: count = count + 2
2
4
6
8
A student wants a procedure to reduce repeated code. This is an example of:
Sequencing
Abstraction
Data compression
Iteration
What does the following procedure do? PROCEDURE triple(n) RETURN n * 3
Divides input by 3
Multiplies input by 3
Adds 3 to input
Prints the input
What is the effect of a loop that never changes its Boolean condition?
Infinite loop
Syntax error
Stops after 10 iterations
Changes variable values automatically
Which of the following is considered an event?
Loop variable updating
User clicking a turtle graphic
Variable storing a list
Program reaching the last line
What type of data is stored in: name = "Jordan"?
Boolean
Number
String
List
Which best describes a list?
A single piece of data
A collection of ordered values
A Boolean expression
A mathematical function
What is `colors[1]` if `colors = ["red", "blue", "green"]`?
red
blue
green
error
Which Python instruction increases `score` by 1?
score = + 1
score = score + score
score += 1
score = score - 1
A Boolean variable stores:
Only positive numbers
True or False values
Any type of list
Only strings
A program records distances from a sensor. What is the best structure to use?
String
Boolean
List
Procedure
What is the output of `DISPLAY(animals[2])` if `animals = ["cat", "dog", "bird"]`?
cat
dog
bird
2
What is an advantage of using a list?
Prevents errors
Automatically sorts
Groups related data
Runs faster than variables
What is the output of the following code? `x = TRUE` `y = FALSE` `RETURN (x AND y)`
TRUE
FALSE
Data abstraction is:
Lowering resolution
Removing data
Hiding implementation details
Compressing data
A function helps programmers by:
Slowing the program
Reducing repeated code
Preventing loops
Increasing memory usage
Correct function definition in pseudocode?
FUNCTION move()
start move:
PROCEDURE(move)
CALL move()
Parameters allow functions to:
Execute without user input
Store lists
Accept input values
Avoid using variables
PROCEDURE addOne(x) RETURN x + 1 addOne(4) returns:
1
3
4
5
Scenario demonstrating abstraction:
Manually writing every detail
Using a function without knowing its internals
Creating more complex functions
Using descriptive names
Best description of a computing innovation:
A theoretical idea
A new computing concept
A practical application of computing
A programming language
Digital data is represented using:
Text
Bits
Images only
Colors
Which of the following is a harmful impact of computing?
Encryption
Storing private data insecurely
Using open-source software
Compressing a file
An autonomous robot in a factory is an example of:
Event-driven programming
Innovation with benefits and harms
Data compression
Boolean logic
What is a beneficial impact of automation?
Increased cyber attacks
Job displacement
Increased productivity
Loss of data
If x = 2, y = 3, and z = x * y + 1, what is the value of z?
3
5
7
9
An infinite loop occurs when:
Loop has a counter
Condition never changes
Loop runs 5 times
Loop inside a function
Using helper function to simplify code is:
Decomposition
Compression
Iteration
Event handling
[72, 75, 80, 79, 70] is:
Boolean
List
String
Function
num = 4 IF num > 2 THEN DISPLAY("High") ELSE DISPLAY("Low")
2
High
Low
Error
Events are:
Loop counters
User/system triggers
Impossible without lists
Hardware only
Function returning random color is example of:
Procedural abstraction
Data conversion
Boolean logic
Iteration
Access last element of nums:
nums[0]
nums[-1]
nums[last]
nums[99]
Hiding complexity inside function is:
Compression
Abstraction
Iteration
Simulation
Repeat until condition false requires:
Sequencing
Conditionals
Loop
Boolean expression
What are algorithms?
A type of data structure
Step-by-step instructions
A programming language
A type of loop
What does pseudocode express?
Syntax rules
Logic without syntax
Data types
Programming errors
What does sequencing mean in programming?
Executing steps in order
Repeating steps infinitely
Choosing between paths
Grouping related data
What is the purpose of conditionals in programming?
To repeat steps
To choose between paths
To group data
To store values
What happens when a condition in a loop remains unchanged?
The loop stops
The loop executes once
The loop causes an infinite loop
The loop skips steps
What does abstraction help with in programming?
Reducing repeated code
Increasing complexity
Storing data
Triggering events
What is the value of animals[2] if animals = ["cat", "dog", "bird"]?
"cat"
"dog"
"bird"
"fish"
What does the keyword FUNCTION represent in programming?
A variable
A loop
A function definition
A conditional statement
What does decomposition help with in problem-solving?
Combining problems
Breaking problems down
Ignoring problems
Solving problems directly
What happens in a loop that never updates?
It stops immediately
It runs infinitely
It skips iterations
It produces errors
