
Subroutines in algorithm

Quiz
•
Computers
•
6th - 8th Grade
•
Easy
Shervon Yak
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a subroutine in computer programming?
A type of new computer
A named block of code that can be called many times
A coloured button on the keyboard
A list of folders on your computer
Answer explanation
A subroutine is a named block of code that can be reused multiple times throughout a program, allowing for better organization and efficiency in coding.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Why would you use a subroutine instead of writing the same code many times?
To make your program longer
To save time and make changes in only one place
To confuse other people
Because subroutines cannot return values
Answer explanation
Using a subroutine allows you to save time by avoiding code duplication. It also makes maintenance easier, as changes can be made in one place rather than multiple locations, reducing errors and improving code clarity.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
According to the subroutine guide, how often can you use the same subroutine in a program?
Only once
Twice
As many times as needed
Only if the teacher says so
Answer explanation
You can use the same subroutine as many times as needed in a program. This allows for code reusability and efficiency, making it easier to manage and maintain your code.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which statement is not a benefit of using a subroutine?
It makes the code easier to reuse
It saves you typing the same lines of code repeatedly
It helps keep your program organised
It hides errors so you don’t have to fix them
Answer explanation
The statement 'It hides errors so you don’t have to fix them' is not a benefit of using a subroutine. Subroutines help organize and reuse code, but they do not conceal errors; errors must still be addressed.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you call a subroutine that requires inputs?
By writing its name and putting the input values in parentheses
By shouting its name
By saving it to the desktop
By pressing the Escape key
Answer explanation
A subroutine that requires inputs is called by writing its name followed by the input values in parentheses. This syntax is standard in many programming languages, allowing the subroutine to receive the necessary data to execute.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is an argument to a subroutine?
The end of a program
A value you pass into the subroutine to use in its calculations
A heated debate with your computer
Another name for a bug
Answer explanation
An argument to a subroutine is a value you pass into it for calculations. This allows the subroutine to perform operations using that specific data, making it flexible and reusable.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If you have a subroutine that draws a square on the screen and you call it four times, how many squares will be drawn?
One
Two
Three
Four
Answer explanation
Calling the subroutine that draws a square four times will result in four separate squares being drawn on the screen. Therefore, the correct answer is Four.
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
7.3.1 - Programming with Scratch baseline assessment

Quiz
•
6th Grade
20 questions
8.2 Scratch FULL QUIZ

Quiz
•
6th Grade
16 questions
Spreadsheet Vocabulary KS3

Quiz
•
7th - 9th Grade
18 questions
Data Representation

Quiz
•
4th - 11th Grade
20 questions
FORMULAS AND FUNCTIONS IN EXCEL

Quiz
•
6th Grade
20 questions
Learn to Code 1 Test

Quiz
•
6th Grade
20 questions
KS3 Year 7 Summative from NCCE

Quiz
•
6th - 8th Grade
16 questions
SHS 7.4 Flowol

Quiz
•
7th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
Appointment Passes Review

Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
Grammar Review

Quiz
•
6th - 9th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
8 questions
Time Management

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
15 questions
Acceptable Use Policy (Quiz)

Quiz
•
6th - 8th Grade
25 questions
Career Vs. Job

Quiz
•
6th - 8th Grade
15 questions
Computer Components Video

Interactive video
•
8th Grade
14 questions
Computer Hardware

Quiz
•
7th Grade
10 questions
Networking Devices and Their Functions

Interactive video
•
5th - 8th Grade