Unable to open this exercise
Common exam pitfall
Students often use != instead of <> for the not-equal-to relational operator in Cambridge pseudocode.
Interactive computing requires reading data dynamically from users and applying arithmetic transformations according to mathematical precedence rules.
1. Accepting Input (INPUT)
The INPUT statement reads data from an external input device (e.g. keyboard) and stores it in a declared variable:
DECLARE StudentAge : INTEGER
OUTPUT "Please enter your age: "
INPUT StudentAge
2. Standard Arithmetic Operators
Cambridge pseudocode supports the five fundamental mathematical operators:
Operator | Operation | Exam Example | Result |
|---|---|---|---|
| Addition |
|
|
| Subtraction |
|
|
| Multiplication |
|
|
| Real Division |
|
|
| Exponentiation (Power) |
|
|
3. Operator Precedence (BODMAS / PEMDAS)
When an expression contains multiple operators, operations are executed in a strict hierarchy:
- Brackets
(...): Expressions inside parentheses evaluate first. - Exponents
^: Evaluated next. - Multiplication
*and Division/: Evaluated left to right. - Addition
+and Subtraction-: Evaluated left to right.
// Without parentheses (Multiplication first):
Result <- 10 + 5 * 2 // 10 + 10 = 20
// With parentheses:
Result <- (10 + 5) * 2 // 15 * 2 = 30
4. Cambridge Relational Operators
Relational operators compare two values and evaluate to a BOOLEAN result (TRUE or FALSE):
Operator | Meaning | True Condition Example | False Condition Example |
|---|---|---|---|
| Equal to |
|
|
| Not equal to |
|
|
| Less than |
|
|
| Less than or equal to |
|
|
| Greater than |
|
|
| Greater than or equal to |
|
|
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Exam-Style Check: Operator Precedence and Relational Symbols
• Multiple ChoiceWhich symbol represents the relational operator "NOT EQUAL TO" in official Cambridge pseudocode?
Interactive exercises for Module 2 and beyond require an active plan.