Using subprograms (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
What is a subprogram?
What is a subprogram?
Self-contained code block that performs a specific task within a larger program
Subprogram reusability
Subprogram reusability
Written once, used many times in same or other programs
What are built-in functions?
What are built-in functions?
Functions already part of the programming language
Example of built-in function
Example of built-in function
print() or len()
What are library functions?
What are library functions?
Functions that need to be imported before use
Example of library function
Example of library function
random.randint() or math.floor()
User-defined subprograms
User-defined subprograms
Custom subprograms created for specific needs
What is abstraction in subprograms?
What is abstraction in subprograms?
Using a subprogram without knowing how it works inside
Generalisation in subprograms
Generalisation in subprograms
Making subprograms work with different input values
Purpose of parameter passing
Purpose of parameter passing
Enables generalisation by sending different values
Subprogram benefit: complexity
Subprogram benefit: complexity
Breaks large programs into smaller manageable chunks
Subprogram benefit: maintenance
Subprogram benefit: maintenance
Fix code in one place, not throughout entire program
