
Subroutines and Functions Activity
Authored by JackR JackR
Computers
10th Grade
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What are two types of subroutine used in programming?
Variables and Constants
Functions and Procedures
Loops and Conditions
Arrays and Strings
2.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
How many parameters can functions and procedures have?
Zero, one or many
Three
One
Two
3.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
Explain the difference between a local and global variables
Local variables can be changed once declared, globals cannot be changed once declared
Local variables are declared using the CONSTANT keyword, globals are declared using the VAR keyword
Local variables are accessible anywhere in the program, globals only within the subroutine
Local variables are only accessible within the particular function or procedure, globals are accessible anywhere in the program
4.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What are three reasons that you should try to use subroutines where possible?
To make the program less maintainable, to decompose the code, to make the program more complex
To reuse code, to make the program less maintainable, to make the program more complex
To make the program more complex, to increase development time, to make program maintenance harder
Reuse code, decomposition, more maintainable code
5.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What is one other advantage of using subroutines?
Subroutines can be stored in a subroutine library and used in different programs if required
To make the program less maintainable
To make program maintenance harder
To make the program more complex
6.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What is output by this program? PROCEDURE changeNum num ← 6 OUTPUT num ENDPROCEDURE #Main program num ← 5 OUTPUT num #call function changenum CALL changeNum OUTPUT num
Outputs 5, Outputs 5, Outputs 6
Outputs 5, Outputs 6, Outputs 6
Outputs 5, Outputs 6, Outputs 5
Outputs 6, Outputs 5, Outputs 5
7.
MULTIPLE CHOICE QUESTION
10 mins • 1 pt
What type of data structure is heights? How will the function be called?
heights is a tuple, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)
heights is an array, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)
heights is a list, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)
heights is a string, The function is called and the result stored with a statement such as: tallest ← CalcMax(pupilHeights)
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
15 questions
Data Security Worksheet
Quiz
•
10th Grade - University
13 questions
Guess the Retro Computer 1
Quiz
•
KG - Professional Dev...
10 questions
Programming Constructs
Quiz
•
5th - 11th Grade
15 questions
# REVIEW 1 DATA TYPES
Quiz
•
10th Grade
11 questions
Threats to Data
Quiz
•
9th - 12th Grade
10 questions
Basic Parts of Speech EPS
Quiz
•
9th - 10th Grade
10 questions
Understanding Backend
Quiz
•
10th Grade
15 questions
Quiz 1
Quiz
•
1st - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade