Subprograms Flashcards

OCR GCSE J277 Computer Science specification

Subprogram

A named, self-contained section of code that performs a specific task, such as a function or procedure.

1 / 10

Ready to master these flashcards?

Sign in to study with spaced repetition and track your progress.

Sign In to Track Progress

Terms in this set (10)

1

Subprogram

A named, self-contained section of code that performs a specific task, such as a function or procedure.

2

Function

A type of subprogram that returns a value after execution.

3

Procedure

A type of subprogram that does not return a value after execution.

4

Purpose of subprograms

To break down a program into smaller, manageable parts, improving readability and reusability.

5

Local variable

A variable that is declared and used within a subprogram, not accessible outside it.

6

Global variable

A variable that is accessible throughout the entire program, including within subprograms.

7

Advantages of subprograms

Improves code readability, reusability, and maintainability. Allows for easier debugging and testing.

8

Passing parameters

The process of providing inputs to a subprogram, either by value or by reference.

9

Return value

The output of a function, sent back to the part of the program that called it.

10

Effective use of subprograms

Using meaningful names, limiting the use of global variables, and ensuring subprograms perform a single, clear task.

Genie

Want to Learn More?

Get personalised lessons, quizzes, and instant feedback from your AI tutor.

Start Learning