OCR J277 · Computational thinking, algorithms and programming
Programming fundamentals revision
Combine variables, input/output, arithmetic, selection and iteration into precise programs.
What to know about programming fundamentals
State, input and output
A variable stores a value that can change during execution. A constant represents a value intended to stay fixed. Assignment updates a variable; comparison tests a relationship without making that assignment. Read inputs, process the values and print outputs in the required order. A meaningful variable name helps a reader understand its purpose.
Sequence and selection
Sequence executes statements in order. Selection chooses a branch using a Boolean condition, for example IF spaces > 0 THEN ... ELSE ... ENDIF. Use relational operators such as ==, !=, <, <=, > and >=. Combine conditions with AND, OR and NOT, adding brackets when needed to make the intended grouping unambiguous.
Focus areas: Programming fundamentals.
Test yourself: questions and answers
Answer each prompt from memory before opening the explanation. These 4 samples come from this topic's 12 original retrieval cards.
What is a variable?
A named storage location/value that can change during execution.
Which construct chooses between alternative paths?
Selection, such as IF ... ELSE.
Can a WHILE loop execute its body zero times?
Yes, if its condition is false before the first iteration.
Why does a post-condition DO ... UNTIL loop run at least once?
Its condition is checked after executing the body.
Turn this topic into a revision session
- Explain one idea without looking at the notes.
- Compare your answer with the guidance and identify the missing link.
- Apply it in a question or short program, then revisit it after a delay.
Free accounts choose one revision topic pack. Pro includes all 26 packs in this course and both published qualifications. Public samples and coding practice are free; PDF guides are separate purchases.
Create a free accountSpecification and sources
Check the required scope against the official OCR J277 specification (PDF). RecallStride's explanations and examples are independent learning resources. See our editorial policy or report a correction, including the topic code and statement concerned.