This acts as a way to access quantities that can change.
What is a variable?
This structure allows different segments to execute based on the truth of the attached boolean.
What is a conditional?
This is used to group repeated code for readability, reusability, and maintainability.
What is a procedure(function)?
A Pro Grammar types nUm1 instead of num1 in part of their program, causing this error.
What is a syntax error?
This specific algorithm is used to find things on large scales.
What is binary search?
This is a term for an external value that is passed into a procedure that does something.
What is a parameter(argument)?
This structure repeats a set of program statements until a certain condition is no longer met(or met depending on the type).
What is iteration(a for/while loop)?
A programmer decides to delete 50 individual variables (enemy1Health, enemy2Health, enemy3Health...) and replaces them with a single list called enemyHealthList. The College Board refers to this specific practice of managing complexity with this term.
What is abstraction?
A student runs their grading program. It successfully compiles, executes without crashing, and displays the final screen, but it calculates a student's final grade as 15% instead of 85%. This specific classification of error has occurred.
What is a logic error?
This is used to represent the time complexity of the program.
What is Big O notation?
list is ["A", "B", "C"]. After executing INSERT(list, 2, "D"), this is the new value sitting at index 3.
What is "B"?
According to De Morgan's Laws, this single boolean expression evaluates to the exact same result as NOT ( (score >= 90) OR (absences = 0) ), but is written without the NOT operator.
What is (score < 90) AND (absences ≠ 0)?
Given the following AP pseudocode, this is the number that will be printed to the screen:
lives <- 3
PROCEDURE TakeDamage(lives)
{
lives <- lives - 1
}
TakeDamage(lives)
DISPLAY(lives)
What is 3?
A programmer writes a program designed to find the mean of two numbers as shown.
num1 <- INPUT()
num2 <- INPUT()
sum <- num1 + num2
average <- sum / 2
DISPLAY(average)
A user inputs "A" and "2" and gets this specific type of error because the program cannot perform arithmetic on non-numeric inputs and does not have a check to ensure inputs are numeric.
What is a runtime error?
Programmers use this specific mathematical concept to represent the time complexity, or run time, of a program as the input size grows.
What is Big O notation?
Given the following AP pseudocode, this is the exact, complete list stored in the variable nums after the code finishes executing:
nums <- [4, 3, 2, 1]
idx <- nums[2]
nums[idx] <- nums[nums[4]]
What is [4, 3, 4, 1]?
A student writes the following AP pseudocode to sort numbers into four groups. Based on the conditionals, these two groups are mathematically impossible for the program to ever display:
IF (num MOD 2 = 0)
{
IF (num MOD 4 = 1)
{
DISPLAY("Group A")
}
ELSE
{
DISPLAY("Group B")
}
}
ELSE
{
IF (num MOD 2 = 0)
{
DISPLAY("Group C")
}
ELSE
{
DISPLAY("Group D")
}
}
What are groups A and C?
We are given two mysterious procedures: Alpha(x, y) always outputs x. Beta(x, y) always outputs y. When a programmer executes the highly nested call Alpha( Beta(5, 10), Alpha(15, 20) ), the computer will evaluate it and output this single number.
What is 10?
A student writes a flawless Binary Search algorithm to find the number 42 in a list of 10,000 integers. However, the program returns "-1" (meaning "Item Not Found"), even though the number 42 is definitively sitting at index 8,401. This is the structural flaw with the list that caused the algorithm to fail.
What is the list not being sorted?
An algorithm is considered to run in an "unreasonable" amount of time if its step count grows at one of these two mathematical rates.
What is Exponential or Factorial?
strA <- "COM"
strB <- "PUT"
strC <- "ERS"
// Rearranging variables
strA <- strC
strC <- strB
strB <- strA
This is the exact string returned by CONCAT(strA, strB).
A programmer is writing a procedure to count how many "peaks" exist in a list of numbers. A "peak" is defined as a number that is strictly greater than both the number immediately before it and the number immediately after it.
PROCEDURE CountPeaks(numList)
{
peaks <- 0
i <- 2
REPEAT UNTIL (i = LENGTH(numList))
{
IF ( [MISSING BOOLEAN] )
{
peaks <- peaks + 1
}
i <- i + 1
}
RETURN peaks
}
When placed in the [MISSING BOOLEAN] blank, this specific boolean expression will cause this program to work as intended.
What is: (numList[i] > numList[i - 1]) AND (numList[i] > numList[i + 1]) ?
A student engineers a reverse-engineering AP pseudo-code block called MysteryGate(a, b). They run several automated test cases and observe the following exact outputs: MysteryGate(10, 20) returns 15. MysteryGate(0, 100) returns 50. MysteryGate(7, 7) returns 7. MysteryGate(-2, 12) returns 5. This is the calculated value of MysteryGate(12, -12).
What is 0?
moves <- ["RIGHT", "RIGHT", "DOWN", "LEFT", "DOWN", "RIGHT", "RIGHT"]
x <- 0
y <- 0
energy <- 20
idx <- 1
REPEAT UNTIL (idx > LENGTH(moves))
{
IF (moves[idx] = "RIGHT")
{
x <- x + 1
energy <- energy - 2
}
IF (moves[idx] = "LEFT")
{
x <- x - 1
energy <- energy - 3
}
IF (moves[idx] = "DOWN")
{
y <- y - 1
energy <- energy - 4
}
idx <- idx + 1
}
This is the exact final output if the program runs:
DISPLAY(x)
DISPLAY(y)
DISPLAY(energy)
What is 3, -2, 1?
This problem-solving approach provides a "good enough" solution when finding the absolute optimal solution would take an unreasonable amount of time.
What is a Heuristic?