1/24
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Variable
A named storage location for a value that can change while a program runs (like a labeled box holding the current value).
Assignment Statement (←)
An action that sets or updates a variable by storing the value of an expression into it at that moment (shown with a left arrow in AP CSP pseudocode).
Reassignment
Updating a variable by assigning it a new value later in the program (overwriting the old value).
Counter
A variable pattern used to track how many times something happens, typically updated with count ← count + 1.
Accumulator (Running Total)
A variable pattern used to add up values over time, typically updated with sum ← sum + newValue.
Swap (using a temporary variable)
A technique to exchange the values of two variables by storing one value in a temporary variable first (temp ← a; a ← b; b ← temp).
Equality Comparison (=)
An operation that checks whether two values are equal (commonly used in conditions), not an assignment in AP CSP pseudocode.
Evaluate-then-Store Execution Order
How assignment runs: first evaluate the right-side expression using current values, then store the result into the left-side variable, overwriting its previous value.
Tracing Code
Step-by-step reasoning through a pseudocode segment to determine the final values of variables after updates and reassignments.
Data Abstraction
Representing complex information in a simplified way to make it easier to store, process, and reason about (in AP CSP, often done with lists).
List
An ordered collection of elements (numbers, strings, Booleans, or even other lists) used to store and process collections of data.
1-Based Indexing (AP CSP)
AP CSP list indexing starts at 1, meaning the first element is at index 1 (not 0).
List Element Access (list[index])
Referring to one item in a list by its position, such as nums[1] for the first element.
List Element Update
Changing a value at a specific list position using assignment, e.g., nums[2] ← 99.
APPEND(list, value)
A list operation that adds a value to the end of a list.
INSERT(list, index, value)
A list operation that puts a value at a specific position and shifts later elements to the right.
REMOVE(list, index)
A list operation that deletes the value at a position and shifts later elements left to fill the gap.
LENGTH(list)
A list operation that returns the number of elements in the list (often used for loops and bounds).
Off-by-One Error
A common indexing mistake where code uses the wrong start/end index (e.g., using 0 in AP CSP or going past LENGTH(list)).
Expression
A combination of values, variables, and operators that can be evaluated to produce a single value (mathematical expressions produce numbers).
Order of Operations
The rule for evaluating expressions: parentheses first, then multiplication/division, then addition/subtraction; missing parentheses can change results.
MOD (Remainder Operator)
An arithmetic operator that returns the remainder after division; often used to test even/odd (n MOD 2) or handle cycles.
String
A sequence of characters used to represent text (names, messages, labels); distinct from numbers meant for arithmetic.
Concatenation
Joining strings together (often using +), such as full ← first + " " + last; different from numeric addition.
Substring
A portion of a string extracted by specifying where to start and how many characters to take; commonly used for parsing and text processing.