Passing Parameters (AQA GCSE Computer Science): Quizzes
📚Quizzes
Practise the questions
12 questions from this quiz
ShowHide
Practise the questions
12 questions from this quiz
What is a subroutine?
What is a subroutine?
A separate block of code with its own name
What is the key advantage of using subroutines?
What is the key advantage of using subroutines?
Code reusability
What are parameters?
What are parameters?
Values passed to a subroutine
What do parameters allow you to do?
What do parameters allow you to do?
Customize subroutine behavior each time
When defining or calling subroutines, what must you always include?
When defining or calling subroutines, what must you always include?
Brackets ()
If you call timestable(8, 10), what does tt become inside the subroutine?
If you call timestable(8, 10), what does tt become inside the subroutine?
8
Do parameter names in a subroutine have to match the variable names passed in?
Do parameter names in a subroutine have to match the variable names passed in?
No, they don't have to match
How can parameters be used inside a subroutine?
How can parameters be used inside a subroutine?
In calculations and outputs
Which benefit means one subroutine can handle many different situations?
Which benefit means one subroutine can handle many different situations?
Flexibility
What is a benefit of easier maintenance with parameters?
What is a benefit of easier maintenance with parameters?
Only update one subroutine if needed
Without parameters, what does a subroutine do?
Without parameters, what does a subroutine do?
Exactly the same thing every time
In timestable(9, 12), what range would the 9 times table print?
In timestable(9, 12), what range would the 9 times table print?
to
