Programming Fundamentals

Unit 2.2 is the heavy-lifting programming unit. Master variables, iteration, arrays, SQL, and subprogrammes using robust high-level language techniques.

Concept Explorer: Variables vs Constants in Memory

A high-level language allocates RAM slots. Constants are locked, whereas Variables can be updated while the programme runs. Try updating them below!

const PI = 3.14
let score = 0

PI (Constant)
3.14
SCORE (Variable)
0

Modules

Interactive Practical Labs

Put your theory into practice. Launch the Python development environments below to write, test, and debug real algorithms.

Topic Mastery Video Library

Deep-dive video tutorials for the most challenging programming and database concepts.

1. Procedures & Parameters

Learn how to define procedures and pass data using arguments and parameters for the OCR J277 exam.

2. Functions & Return Values

Master the 'return' keyword and learn how functions process data and give back values to your main code.

3. Subroutine Exam Walkthrough

A walkthrough of common 3, 4, and 6-mark subroutine questions, focusing on logic error spotting and structure.

4. Scope, Strings & Validation

Master variable scope, string manipulation techniques, and input validation using `while` loops for Paper 2.

5. SQL Basics (SELECT, FROM, WHERE)

Learn the Structured Query Language fundamentals and how to search for data. Includes a bonus on SQL Injection!

6. 1D Arrays & Zero-Indexing

Master the theory of fixed-length arrays, the trap of zero-indexing, and how to iterate using FOR loops to calculate totals.

7. 2D Arrays & Exam Walkthrough

Learn how to navigate 2D grids using [row][col] coordinates and master a high-tariff 5-mark exam walkthrough.

Check Your Understanding

1. What is the fundamental difference between a Variable and a Constant?

2. An algorithm relies on evaluating True / False logic gates. What specific operator type is this known as?

Written Exam Scenario (AO2/AO3)

Stretch (Grade 9)

"A school is designing a grading system algorithm. The passing grade will always be 50 marks. Explain why the developer should declare the passing grade as a Constant rather than a Variable." (3 marks)