Sub Programs (OCR GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What are sub programs used for?
What are sub programs used for?
To structure larger programs
What is the key difference between functions and procedures?
What is the key difference between functions and procedures?
Functions return a value, procedures don't
What does a function do after performing a task?
What does a function do after performing a task?
Returns a value
What type of sub program would you use to print output without returning a value?
What type of sub program would you use to print output without returning a value?
Procedure
How do sub programs help improve code structure?
How do sub programs help improve code structure?
By avoiding repetition
What is modular programming?
What is modular programming?
Each part does one thing and is reusable
When should you use sub programs?
When should you use sub programs?
For repetitive tasks
When should you use a function rather than a procedure?
When should you use a function rather than a procedure?
When returning a specific result
Where are local variables declared and where can they be accessed?
Where are local variables declared and where can they be accessed?
Inside a sub program; within it only
Where are global variables accessible?
Where are global variables accessible?
Throughout the entire program
What is a risk of using global variables?
What is a risk of using global variables?
Unintended side effects
What can be done with arrays in sub programs?
What can be done with arrays in sub programs?
Passed to and returned from them
