Which of the following is an advantage of using local variables?

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
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 Quizizz
10 questions
Visual Basic I

Quiz
•
10th - 11th Grade
11 questions
Control Structures - Selection in Python

Quiz
•
8th Grade - University
15 questions
Eval. 1BIM - 1ro B

Quiz
•
7th Grade - University
16 questions
Python basics

Quiz
•
9th - 12th Grade
17 questions
Python

Quiz
•
6th - 10th Grade
10 questions
Global and local variables

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

Quiz
•
10th Grade
10 questions
IGCSE Computer Science - Chapter 9: Problem-Solving and Design

Quiz
•
9th - 10th Grade
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade
Discover more resources for Computers
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
20 questions
Taxes

Quiz
•
9th - 12th Grade
17 questions
Parts of Speech

Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression

Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing

Quiz
•
9th - 12th Grade
10 questions
Identifying equations

Quiz
•
KG - University