
Functions & procedures

Quiz
•
Computers
•
10th - 12th Grade
•
Hard
Louise Lockwood
Used 55+ times
FREE Resource
14 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an advantage of using local variables?
They allow the variable to be used throughout the whole program
They allow variable identifiers to be reused each time
They are easier to program than global variables
A wider range of data types can be used
Answer explanation
Local variables allow variable identifiers to be reused each time, making them an advantage over global variables.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What term is used to describe data passed into/out of a program?
Variable
Loop
Constant
Parameter
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Leo wants to create a subroutine that will roll a dice. Which syntax is correct?
def dice roll ():
def diceroll ()
def diceroll ():
def diceroll []:
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would the output be from the program shown here? (assuming that the user enters "John" and "Smith"
John
Smith
John Smith
Error
Answer explanation
The correct answer is 'Error' because the program does not concatenate the input strings 'John' and 'Smith', resulting in an error.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a procedure?
A small section of code within a program which performs a task
Code which produces a calculated result
Answer explanation
A procedure is a small section of code within a program that performs a task, making it the correct choice.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a variable has "global scope" it can be
used anywhere in the program
only used outside of a function
only used inside of a function
used outside of the program
Answer explanation
If a variable has 'global scope', it can be used anywhere in the program, not restricted to a specific function or part of the code.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a variable has "local scope" it is available for use outside of its function.
TRUE
FALSE
Answer explanation
FALSE - If a variable has 'local scope', it is only available for use within its function and not outside of it.
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
J277 Programming - Data Types

Quiz
•
9th - 11th Grade
19 questions
ProA Desarrollo de Software 3° año

Quiz
•
1st - 12th Grade
10 questions
KS4 Programming Techniques (1)

Quiz
•
8th - 10th Grade
14 questions
Computing Revision JCG

Quiz
•
KG - University
14 questions
Python User Defined Functions

Quiz
•
12th Grade
16 questions
Variables

Quiz
•
7th - 10th Grade
10 questions
07 - Nested Structures

Quiz
•
12th Grade
16 questions
Subroutines

Quiz
•
9th - 11th Grade
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
10 questions
Afterschool Activities & Sports

Quiz
•
6th - 8th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
15 questions
Cool Tool:Chromebook

Quiz
•
6th - 8th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
3rd Grade
20 questions
Bullying

Quiz
•
7th Grade
18 questions
7SS - 30a - Budgeting

Quiz
•
6th - 8th Grade