Subprograms (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
15 cards from this deck
ShowHide
Practise the cards
15 cards from this deck
What is a subprogram?
What is a subprogram?
A self-contained sequence of instructions that performs a specific task
Main benefit of subprograms
Main benefit of subprograms
Avoid code repetition, improve organization and readability
Two types of subprograms
Two types of subprograms
Functions and procedures
What does a function do?
What does a function do?
Performs work and returns a value
What does a procedure do?
What does a procedure do?
Performs an action but doesn't return a value
Definition of arguments
Definition of arguments
Actual values sent to a subprogram when calling it
Definition of parameters
Definition of parameters
Labeled boxes that receive and store values in subprograms
What are built-in subprograms?
What are built-in subprograms?
Ready-to-use functions/procedures available without setup
What does input() return?
What does input() return?
Always returns a string
Is print() a function or procedure?
Is print() a function or procedure?
Procedure (doesn't return a value)
What does len() return?
What does len() return?
Returns an integer (count of items)
What does float() do?
What does float() do?
Converts text or integers into decimal numbers
Purpose of import keyword
Purpose of import keyword
To use library subprograms/modules in your code
What does math.floor() do?
What does math.floor() do?
Returns largest whole number the decimal
What does math.ceil() do?
What does math.ceil() do?
Returns smallest whole number the decimal
