135. OCR A Level (H046-H446) SLR23 – 2.2 Global & local variable

135. OCR A Level (H046-H446) SLR23 – 2.2 Global & local variable

11th Grade

15 Qs

quiz-placeholder

Similar activities

Subroutines - Procedures & Functions

Subroutines - Procedures & Functions

9th - 12th Grade

20 Qs

General Python year 10

General Python year 10

9th Grade - University

20 Qs

Recursion Quiz (CP 2)

Recursion Quiz (CP 2)

10th - 12th Grade

15 Qs

Time machine week 4

Time machine week 4

9th - 12th Grade

15 Qs

Understanding Programming Constructs

Understanding Programming Constructs

10th Grade - University

10 Qs

Variables Constants Datatypes

Variables Constants Datatypes

8th - 12th Grade

15 Qs

Module 2 - Lesson 7

Module 2 - Lesson 7

6th - 12th Grade

13 Qs

GCSE Computer Science - Programming Keywords

GCSE Computer Science - Programming Keywords

9th - 12th Grade

15 Qs

135. OCR A Level (H046-H446) SLR23 – 2.2 Global & local variable

135. OCR A Level (H046-H446) SLR23 – 2.2 Global & local variable

Assessment

Quiz

Computers

11th Grade

Hard

Created by

James Cole

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What should you have a solid understanding of before watching the videos?

None of the above

History of computer science

Advanced algorithmic strategies

Basic programming concepts and different data types

Answer explanation

Before watching the videos, you should have a solid understanding of basic programming concepts and different data types.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the main purpose of the videos?

To focus solely on theoretical knowledge

To teach programming concepts from scratch

To provide entertainment

To reinforce and consolidate understanding of programming techniques

Answer explanation

The main purpose of the videos is to reinforce and consolidate understanding of programming techniques.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does one become a good programmer according to the text?

By programming little and often

By only studying theory

By watching videos exclusively

By avoiding programming practice

Answer explanation

To become a good programmer, one should program little and often according to the text.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a local variable?

At the top of a program

None of the above

Only within a subroutine

Throughout the program

Answer explanation

Local variables have scope only within the subroutine where they are declared, not throughout the entire program.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Where is a global variable typically declared?

Within a specific function only

At the top of a program

At the bottom of a program

Inside a subroutine

Answer explanation

A global variable is typically declared at the top of a program to make it accessible throughout the entire program, not limited to a specific function or subroutine.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens to local variables when the subroutine ends?

They are converted into constants

They remain active throughout the program

They are destroyed

They become global variables

Answer explanation

Local variables are destroyed when the subroutine ends, they do not remain active or become global variables.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can two variables share the same name if they have different scopes?

Only if they are constants

No

Only in specific programming languages

Yes

Answer explanation

Yes, two variables can share the same name if they have different scopes in programming.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?