In AP Computer Science Principles, an expression is a combination of values, variables, operators, and procedure calls that evaluates to a single value, following the order of operations defined by the programming language (EK AAP-2.B.3 and AAP-2.B.4).
An expression is any piece of code that produces a single value when evaluated. That's the whole idea. 5 is an expression. x is an expression. a * b / c is an expression. So is a procedure call like RANDOM(1, 10), because it returns a value. The CED spells this out directly. An expression can consist of a value, a variable, an operator, or a procedure call that returns a value (EK AAP-2.B.3), and expressions are evaluated to produce a single value (EK AAP-2.B.4).
Here's the intuition. An expression is a question the computer answers with one value. 17 MOD 5 asks "what's the remainder when 17 is divided by 5?" and the answer is 2. Evaluation follows a set order of operations defined by the language (EK AAP-2.B.5), so 2 + 3 * 4 evaluates to 14, not 20. On the AP exam, you'll work with the pseudocode reference sheet operators +, -, *, /, and MOD (EK AAP-2.C.3), and you need to evaluate expressions using them quickly and correctly.
Expressions live in Topic 3.3 (Mathematical Expressions) in Unit 3: Algorithms and Programming, supporting learning objectives 3.3.B (represent a step-by-step algorithmic process using sequential code statements) and 3.3.C (evaluate expressions that use arithmetic operators). But they're really the atoms of all of Unit 3. Every assignment statement, every condition in a selection statement, every loop bound contains an expression. If you can't evaluate (5 * 3) MOD 7 correctly, you can't trace the IF statement that uses it. Expressions also connect to EK AAP-2.A.4, since every algorithm is built from sequencing, selection, and iteration, and expressions are what those structures actually compute with.
Arithmetic Operators (Unit 3)
Operators are the verbs inside an expression. The exam reference sheet gives you exactly five arithmetic operators (+, -, *, /, MOD), and most expression questions test whether you apply them in the right order.
Modulus Operator (Unit 3)
MOD is the operator AP CSP loves most because it's the one students see least in math class. a MOD b evaluates to the remainder when a is divided by b, so 17 MOD 5 is 2. It shows up constantly in expressions that check for even numbers or cycle through a range.
Variable (Unit 3)
Variables are how expressions get their inputs and where results get stored. An assignment statement like total ← a + b evaluates the expression on the right first, then stores that single value in the variable on the left.
Function Call (Unit 3)
A procedure call that returns a value counts as an expression all by itself (EK AAP-2.B.3). That's why you can nest calls inside larger expressions, like RANDOM(1, 6) + RANDOM(1, 6) to simulate rolling two dice.
Multiple-choice questions hand you variable values and ask you to evaluate an expression, like finding the value of a * b / c + a MOD c * b when a = 5, b = 3, and c = 2. The trap is almost always order of operations or a MOD mistake, so evaluate left to right within the same precedence level and don't rush. On the Written Response questions (like 2024 and 2025 Q2), you analyze the conditional statements in your own Personalized Project Reference, and every condition contains an expression you may need to identify, explain, or trace. Practice reading an expression and stating in one sentence what single value it produces and why.
An expression evaluates to a value; a statement performs an action (EK AAP-2.B.2). a + b is an expression because it produces one value. total ← a + b is a statement because it does something, namely storing that value in a variable. Quick test, ask "does this hand me back a value?" If yes, it's an expression. Statements usually contain expressions inside them, which is why the two get tangled together.
An expression is a combination of values, variables, operators, and procedure calls that evaluates to a single value (EK AAP-2.B.3 and AAP-2.B.4).
Expressions follow a set order of operations defined by the programming language, so 2 + 3 * 4 is 14, not 20 (EK AAP-2.B.5).
The AP exam reference sheet gives you five arithmetic operators: +, -, *, /, and MOD (EK AAP-2.C.3).
a MOD b evaluates to the remainder when a is divided by b, so 17 MOD 5 evaluates to 2 (EK AAP-2.C.2).
A procedure call that returns a value is itself an expression, which is why calls can be nested inside larger calculations.
An expression produces a value while a statement performs an action, and assignment statements evaluate the expression on the right before storing the result.
An expression is a combination of values, variables, operators, and procedure calls that evaluates to a single value. For example, a * b + 3 with a = 5 and b = 3 evaluates to 18.
Yes. The CED says an expression can consist of just a value or just a variable (EK AAP-2.B.3). 7 and x are both valid expressions because each evaluates to a single value.
An expression produces a value, while a statement carries out an action (EK AAP-2.B.2). score + 10 is an expression, but score ← score + 10 is an assignment statement that contains an expression.
a MOD b evaluates to the remainder when a is divided by b, assuming a is at least 0 and b is greater than 0. So 17 MOD 5 is 2, and x MOD 2 equaling 0 means x is even.
Mostly yes. Multiplication, division, and MOD happen before addition and subtraction, and operations at the same level evaluate left to right. The key is that the order is defined by the language (EK AAP-2.B.5), so always follow the reference sheet rather than assuming.