Search Header Logo

Midterm Exam Review

Authored by Romualdo Bautista

Computers

University

Used 11+ times

Midterm Exam Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In JavaScript, what is the scope of a variable declared with the let keyword within a block?

a) Function scope

b) Global scope

c) Block scope

d) Module scope

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about variable lifetime is true?

a) A global variable's lifetime is limited to the block in which it is defined.

b) A local variable's lifetime extends across the entire program.

c) A static variable's lifetime is the duration of the program's execution.

d) An automatic variable's lifetime is the duration of the program's execution.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes "scope" in programming?

a) The duration for which a variable exists in memory.

b) The region of the code where a variable is accessible.

c) The process of associating a variable with a value.

d) The technique used to allocate memory for variables.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, if a variable is declared outside any function or class, what is its scope?

a) Local

b) Enclosed

c) Global

d) Built-in

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary difference between "static" and "dynamic" binding?

a) Static binding occurs at runtime, whereas dynamic binding occurs at compile-time.

b) Static binding occurs at compile-time, whereas dynamic binding occurs at runtime.

c) Static binding is used only for global variables, whereas dynamic binding is used for local variables.

d) Static binding is for variables, whereas dynamic binding is for functions.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes "binding" in programming?

a) The region of the code where a variable is accessible.

b) The duration for which a variable exists in memory.

c) The process of associating a variable with a value or function.

d) The method used to manage memory allocation.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used in many programming languages to refer to a variable in the global scope from within a local scope?

a) local

b) global

c) extern

d) static

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?