OPL Chapter 6
For length option(s) of string data type, some languages (e.g., C and C++), it is ___. In these languages, a special character is used to indicate the end of a string's characters, rather than maintaining the length. A. Static Length B. Limited Dynamic Length C. Dynamic Length (no maximum) D. Heap Length E. Stack-dynamic Length
Limited Dynamic Length
For length option(s) of string data type, some languages (e.g., COBOL, Java's String class), it is ___. A. Static Length B. Limited Dynamic Length C. Dynamic Length (no maximum) D. Heap Length E. Stack-dynamic Length
Static Length
To store a fixed number of decimal digits, in coded form (BCD), it uses ___ bits for a decimal digit. A. 2 B. 4 C. 8 D. 16 E. 32 F. 64
4
Static scoping is a central feature of ___ and some of its descendants. A. ALGOL 60 B. COBOL C. FORTRAN D. LISP E. ADA
ALGOL 60
___ are two or more variables bound to the same storage address. A. Alias B. Bindings C. Coercions D. Unions E. Allocations
Alias
A(n) ___ defines a collection of data objects and a set of predefined operations on those objects A. Data type B. Polymorphism C. Container D. Program Abstraction E. Data structure
Data type
A(n) ___ is the collection of the attributes of a variable A. Array B. Alias C. Data D. Descriptor E. Functor
Descriptor
A(n) _____ array is an unordered collection of data elements that are indexed by an equal number of values called keys A. associative B. jagged C. homogeneous D. hetrogeneous E. multi-dimensional
associative
In general, ___ binding allows greater flexibility but at the expense of readability, efficiency, and reliability. A. static B. local C. compile-time D. dynamic E. stack
dynamic
Scalar variables can be separated into four categories by considering their lifetimes. Which is not one of them? A. static B. dynamic C. stack dynamic D. explicit heap dynamic
dynamic
Arrays can be ___, as with Java's objects. A. static B. stack-dynamic C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory
fixed heap dynamic
With this binding, storage binding is dynamic but fixed after allocation (i.e., binding is done when requested and storage is allocated from heap, not stack). A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic
fixed heap-dynamic
Arrays can be ___, as in C functions (without the static specifier). A. static B. temporary stack C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory
fixed stack-dynamic
With this binding, array subscript ranges are statically bound, but the storage allocation is done at declaration time. The advantage is space-efficiency. A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic
fixed stack-dynamic
With this binding, binding of subscript ranges and storage allocation is dynamic and can change any number of times. The advantage is flexibility (as arrays can grow or shrink during program execution). A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic
heap-dynamic
____ type equivalence means the two variables have equivalent types if they are in either the same declaration or in declarations that use the same type name. A. simple B. name C. strong D. weak E. anonymous
name
In several languages that support object-oriented programming, records are supported with ___. A. primitives B. arrays C. objects D. methods E. heaps
objects
A(n) ____ is a possibly heterogeneous aggregate of data elements in which the individual elements are identified by names A. array B. object C. bag D. record E. table
record
The ___ environment of a statement is the collection of all of the variables that are visible to that statement. A. binding B. referencing C. static D. dynamic E. symbolic
referencing
With this binding, array subscript ranges are dynamically bound and the storage allocation is dynamic (done at run-time). The advantage is flexibility as the size of an array need not be known until the array is to be used. A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic
stack-dynamic
Arrays can be ___, as in C++ arrays whose definition includes the static specifier. A. static B. stack-dynamic C. fixed stack-dynamic D. fixed heap dynamic E. physical memory F. virtual memory
static
With this binding, array subscript ranges are statically bound and storage allocation is static (before run-time). The advantage is efficiency (for no dynamic allocation). A. static B. fixed stack-dynamic C. stack-dynamic D. fixed heap-dynamic E. heap-dynamic
static
Binding can be ___. A. coercing or casting B. implicit or explicit C. static or dynamic D. local or global E. internal or external
static or dynamic
Variables can be characterized by the sextuple of attributes. Which is not one of these six attributes? A. name B. type C. lifetime D. storage E. scope
storage
A(n) ___ is a homogeneous aggregate of data elements in which an individual element is identified by its position in the aggregate, relative to the first element. A. Array B. Record C. Object D. Structure E. Union
Array
Array ___ is a mapping from indices to elements. A. Indexing B. Range C. Length D. Initializing E. Ordering
Indexing
___ data types are not defined in terms of other data types A. Static B. Dynamic C. Heap D. Primitive E. Generic
Primitive