CSCI 316: Quiz 5 - Names, Bindings, Scopes
Sign in to Google
to save your progress.
Learn more
* Indicates required question
Email
*
Your email
Last Name
*
Your answer
First Name
*
Your answer
Student Id
*
Your answer
What is the primary purpose of names in programming languages?
*
1 point
To provide a means of referring to program entities
To represent memory addresses directly
To improve execution speed
To define scope rules
To enforce type safety
Which statement best defines a binding?
*
1 point
Association between an attribute and an entity
Lifetime of a variable
Scope of an identifier
Visibility of a name
Allocation of memory to variables
Which attribute is not typically bound to a variable?
*
1 point
Scope
Value
Storage location
Font style
Type
Binding that occurs before program execution is called:
*
1 point
Static binding
Deferred binding
Dynamic binding
Runtime binding
Late binding
Which binding time is associated with stack-dynamic variables?
*
1 point
Load time
Design time
Link time
Compile time
Runtime
A variable is best described as:
*
1 point
A fixed memory address
An abstraction of a memory cell
A name permanently bound to a value
A constant expression
A scope delimiter
Which category of variables has the shortest lifetime?
*
1 point
Global variables
Static variables
Explicit heap-dynamic variables
Implicit heap-dynamic variables
Stack-dynamic variables
Which variable category is allocated and deallocated by direct programmer commands?
*
1 point
Automatic
Stack-dynamic
Explicit heap-dynamic
Implicit heap-dynamic
Static
Implicit heap-dynamic variables are most commonly found in:
*
1 point
Fortran
Java
Python
C
Ada
Which is a disadvantage of static variables?
*
1 point
Lack of recursion support
Complex allocation mechanism
Poor readability
High runtime overhead
Unpredictable lifetime
The scope of a variable refers to:
*
1 point
The region of program text where it is visible
The memory it occupies
The period during execution it exists
The type of the variable
Its binding time
Which scoping rule binds names based on program structure?
*
1 point
Dynamic scoping
Static scoping
Deep scoping
Temporal scoping
Shallow scoping
Which scoping rule determines bindings based on call sequence?
*
1 point
Nested
Static
Dynamic
Lexical
Block
Most modern programming languages use:
*
1 point
Late scoping
Shallow binding
Dynamic scoping
Static scoping
Temporal scoping
The referencing environment of a statement is:
*
1 point
All variables in memory
All declared variables
All heap-allocated objects
All variables visible at that point
All global variables
Lifetime of a variable is defined as:
*
1 point
Its scope
The period during which storage is allocated
Runtime visibility
Storage class
Its binding to a type
Which is an advantage of dynamic scoping?
*
1 point
Easier static analysis
Faster compilation
Greater flexibility in execution
Better type safety
Improved readability
Which is a major disadvantage of dynamic scoping?
*
1 point
No recursion support
Complex garbage collection
Increased memory usage
Excessive compile-time checks
Reduced readability and reliability
Named constants are usually bound at:
*
1 point
Compile time
Design time
Runtime
Load time
Link time
Which feature most directly improves program reliability?
*
1 point
Shallow binding
Dynamic scoping
Static scoping
Implicit heap-dynamic variables
Late binding
Aliasing occurs when:
*
1 point
Multiple names reference the same memory location
Names are resolved dynamically
Variables shadow each other
Scopes overlap
Multiple types bind to one variable
Excessive aliasing primarily reduces:
*
1 point
Portability
Compilation speed
Type inference accuracy
Performance
Readability and reliability
Which feature most commonly causes aliasing?
*
1 point
Constants
Pointers or references
Local variables
Static variables
Value parameters
Under static scoping, nonlocal references are resolved using:
*
1 point
Heap traversal
The program’s lexical structure
The most recent activation record
Random search
The call stack
Which mechanism supports access to nonlocal variables in nested subprograms?
*
1 point
Garbage collector
Static chain
Dynamic chain
Hash table
Heap manager
Deep binding determines bindings:
*
1 point
At subprogram call time
At variable declaration
At compile time
At subprogram definition time
At program load
Shallow binding determines bindings:
*
1 point
At program start
At subprogram call time
At subprogram exit
At block entry
At compile time
Which statement reflects the correct relationship between scope and lifetime?
*
1 point
Scope is determined only at runtime
Scope and lifetime are independent concepts
Lifetime applies only to heap variables
Lifetime always exceeds scope
Scope always equals lifetime
Which design goal is best supported by static scoping?
*
1 point
Reduced memory usage
Shorter programs
Execution speed
Program readability
Program flexibility
The chapter emphasizes names, bindings, and scopes because they:
*
1 point
Affect syntax design
Control execution order
Define data types
Are fundamental to variable behavior and program reliability
Implement exception handling
A copy of your responses will be emailed to the address you provided.
Submit
Clear form
Never submit passwords through Google Forms.
reCAPTCHA
Privacy
Terms
This content is neither created nor endorsed by Google. -
Terms of Service
-
Privacy Policy
Does this form look suspicious?
Report
Forms
Help and feedback