Subroutines that Return Values (AQA GCSE Computer Science): Flashcards

📚Flashcards
Subroutines that Return Values
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

Functions in programming

Subroutines that calculate and return a value

Procedures in programming

Subroutines that carry out tasks without returning anything

Key difference: functions vs procedures

Functions return a result, procedures just do something

RETURN keyword in pseudocode

Sends a value back to the main program from a function

Local variables

Variables created inside a function

Local scope meaning

Variables only exist inside their specific function

Accessing local variables from main program

Causes an error - local variables only exist inside function

Modularisation benefit of functions

Break large program into smaller, manageable chunks

Reusability benefit of functions

Use function multiple times without rewriting code

Maintenance benefit of functions

Update code in one place only

Clear interfaces benefit of functions

Clear inputs (parameters) and outputs (return values)

Functions and structured programming

Makes code organised, reusable, and easier to maintain

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

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