Expressions, Selection, Loops and Functions
Read, explain and implement assignment, arithmetic, concatenation, comparisons, logical operators, loops and required predefined functions.
How to study National 5 Computing Science
Move from functional requirements to designs and implementation, trace data and code carefully, and support testing and evaluation with evidence.
Core concepts
Concept 1
Expressions assign or calculate values using addition, subtraction, multiplication, division and exponentiation, or concatenate strings.
Exam cue: Evaluate brackets, arithmetic, comparisons and logical operators in a controlled order.
Concept 2
Simple and complex conditions use comparison operators with AND, OR and NOT.
Exam cue: Choose a fixed loop only when the required number of repetitions is known.
Concept 3
Fixed loops repeat a known number of times; conditional loops depend on a condition.
Concept 4
Required predefined functions include random, round and length, each used with parameters.
Risk pitfalls and guardrails
Using OR where every condition must be true.
Guardrail: Check option route, data type, valid boundary, loop condition, array index, identifier and expected output before committing to the response.
Changing a loop control value in the wrong direction or not at all.
Guardrail: Check option route, data type, valid boundary, loop condition, array index, identifier and expected output before committing to the response.
Confusing string concatenation with numeric addition.
Guardrail: Check option route, data type, valid boundary, loop condition, array index, identifier and expected output before committing to the response.
Memory anchors
Assignment
Store the result of an expression in a named variable.
Complex condition
Combine comparisons using AND, OR or NOT.
Fixed loop
Repeat a known number of times.
Conditional loop
Repeat while or until a stated condition controls continuation.
Random function
Generate a value within the range defined by its parameters.
Round and length
Round changes numeric precision; length returns the number of characters or stored elements.
Checkpoint rule
Do the check-up only after you can summarize each concept in one sentence and identify one dangerous pitfall from memory.
Knowledge Check (after reading)
Short check-up to confirm understanding of this module.
Check-up Questions
What does array length describe?
Why initialise an array before reading its elements?
Answer all questions to submit.
Next step personalized recommendations
Continue learning
Move forward only after this module is stable.
What is Pass Harbor?
Completely free exam prep for 247 UK exams.
- Practice questions
- Flashcards
- Study guides
- Mock exams
- No registration
- No paywall
- Start instantly
“No more expensive exam prep. Quality study tools should be accessible to everyone.”
