Passing Parameters (AQA GCSE Computer Science): Flashcards

📚Flashcards
Passing Parameters
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

What is a subroutine?

Named code block outside main program, callable multiple times

Main advantage of subroutines

Code reusability - write once, call whenever needed

What 'calling' a subroutine means

Running the subroutine

What are parameters?

Values passed to subroutine to customize its behavior

Purpose of empty brackets () in subroutines

Where parameters go when used

Effect of parameters on subroutine

Customize what subroutine does each time called

Subroutine without parameters

Always does exactly the same thing

When calling with parameters, you provide

The actual values

Why parameter order matters

1st value goes to 1st parameter, 2nd to 2nd, etc.

Flexibility benefit of parameters

One subroutine handles many different situations

Code reduction benefit of parameters

Write one subroutine instead of many versions

Maintenance benefit of parameters

Update once in one place instead of multiple locations

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

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