Topic module

Subprograms, Scope, Operations and Files

Use parameters, local and global scope, functions, procedures, predefined operations and sequential text or CSV files.

Long-form learning
Concept to Risk to Memory to Check-up

How to study Higher Computing Science

Move from requirements to structured designs, trace code and data precisely, and support every test or evaluation judgement with observable evidence.

Core concepts

Concept 1

Formal parameters appear in a subprogram definition; actual parameters are supplied by a call.

Exam cue: Match actual arguments to formal parameters by position, role and compatible type.

Concept 2

Functions return a value while procedures perform a named task through their defined inputs and outputs.

Exam cue: Choose a function when one returned value naturally represents the module’s output.

Concept 3

Local scope limits a variable to a subprogram; global variables are accessible more widely and can create hidden dependencies.

Exam cue: Track file state and position through open, read or write, and close operations.

Concept 4

Required predefined operations include substrings, character–ASCII conversion, floating-point-to-integer conversion and modulus.

Concept 5

Sequential CSV and text files must be opened or created, read or written in order, and closed.

Risk pitfalls and guardrails

Calling the value in a subprogram heading an actual parameter.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Assuming a local variable keeps the same value between unrelated calls.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Using integer division when modulus or a conversion operation is required.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Reading from or writing to a file that has not been opened.

Guardrail: Check route, scope, data type, boundary, loop condition, identifier and expected output before committing to the response.

Memory anchors

Formal parameter

A named input or output declared in the subprogram definition.

Actual parameter

The value or variable supplied in the subprogram call.

Function

A subprogram that returns a value to the calling expression.

Local variable

A variable whose scope is limited to its defining subprogram or block.

Modulus

The modulus operation returns the remainder after integer division.

Sequential file cycle

Open or create the file, process records in sequence, then close it.

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

1-2 question checkpoint

What is displayed? SET total TO 7 SET total TO total + 5 SEND total TO DISPLAY

What is displayed? SET value TO 17 MOD 5 SEND value TO DISPLAY

Answer all questions to submit.

Next step personalized recommendations

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.