
Subroutines and Functions Activity

Quiz
•
Computers
•
10th Grade
•
Hard
JackR JackR
Used 1+ times
FREE Resource
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)
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
IDE Functions Quiz

Quiz
•
9th Grade - University
12 questions
Translators

Quiz
•
10th Grade
20 questions
Python Basics Review (TSK)

Quiz
•
9th - 12th Grade
13 questions
Python Functions

Quiz
•
9th - 12th Grade
10 questions
Classification of programming languages

Quiz
•
10th Grade
20 questions
Very Basic Programming

Quiz
•
10th - 12th Grade
10 questions
SLR 9 - Advanced Programming Techniques - Part Two

Quiz
•
10th Grade
17 questions
Programming Languages H&L

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

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

Interactive video
•
6th - 10th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade