OCR J277 · Computational thinking, algorithms and programming
Programming techniques revision
Use strings, arrays, subprograms, file operations, records, SQL and random values in structured solutions.
What to know about programming techniques
String operations
Strings can be joined by concatenation and inspected using their length and indexed characters. In this studio, indexing starts at zero: label[0] is the first character. label.substring(start, count) returns count characters beginning at start; left(count), right(count), upper and lower are also supported. Check the required convention: substring parameters in another language may mean start/end instead of start/count.
Arrays and two-dimensional data
An array stores a collection accessed by index. An array of five values has indices 0–4 under zero-based indexing. A two-dimensional array uses row and column indices, useful for a seating grid or table of measurements. Traverse valid bounds and initialise accumulators before loops. A record groups related fields describing one entity; a collection of records can contain different named field types.
Focus areas: Programming techniques.
Test yourself: questions and answers
Answer each prompt from memory before opening the explanation. These 4 samples come from this topic's 16 original retrieval cards.
In this studio, what does "CAMERA".substring(1,3) produce?
AME: three characters starting at index 1.
What indices are valid for five zero-indexed array items?
0, 1, 2, 3 and 4.
What distinguishes a function from a procedure in this course?
A function returns a value for use by the caller.
What is a parameter?
A named input used by a subprogram; the calling argument supplies its value.
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.