Explore

Subprograms Flashcards
OCR GCSE J277 Computer Science specification
Ready to master these flashcards?
Sign in to study with spaced repetition and track your progress.
Sign In to Track ProgressTerms in this set (10)
Subprogram
A named, self-contained section of code that performs a specific task, such as a function or procedure.
Function
A type of subprogram that returns a value after execution.
Procedure
A type of subprogram that does not return a value after execution.
Purpose of subprograms
To break down a program into smaller, manageable parts, improving readability and reusability.
Local variable
A variable that is declared and used within a subprogram, not accessible outside it.
Global variable
A variable that is accessible throughout the entire program, including within subprograms.
Advantages of subprograms
Improves code readability, reusability, and maintainability. Allows for easier debugging and testing.
Passing parameters
The process of providing inputs to a subprogram, either by value or by reference.
Return value
The output of a function, sent back to the part of the program that called it.
Effective use of subprograms
Using meaningful names, limiting the use of global variables, and ensuring subprograms perform a single, clear task.

Want to Learn More?
Get personalised lessons, quizzes, and instant feedback from your AI tutor.
Start Learning