Subroutines (AQA GCSE Computer Science): Flashcards

📚Flashcards
Subroutines
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Definition of subroutine

Reusable code block defined once & used multiple times

Why break programs into subroutines

Makes code easier to read, debug & maintain

First step when subroutine called

Main program temporarily stops

Where control returns after subroutine

Back to main program where it left off

Keywords to define subroutine

SUBROUTINE and ENDSUBROUTINE

Definition of parameter

Value passed into subroutine

Why use parameters

Makes subroutines flexible & reusable

Rule for calling with parameters

Provide correct number & order of values

Code reusability benefit

Write once, use many times

Easier maintenance benefit

Update in one place, not entire program

How to call a subroutine

Write its identifier (name) with parentheses

Organization benefit

Breaks program into logical chunks

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.