Chapter 8: Data Types

Ace your homework & exams now with Quizwiz!

Type declaration is the process of __. A. Inferring new data types B. Creating type constructors C. Naming new data types D. Associating data types of identifiers

Naming new data types

__ equivalence in type checking is when two objects are built in the same way using the same type constructors from the same simple types. A. Referential B. Simple C. Constructor D. Structural

Structural

In C, the Cartesian product type constructor is available as the __ construction. A. structure B. set C. array D. enumerator

Structure

To create a new data type that contains a subset of a known data type, the __ mechanism is used. A. subtype B. anonymous union C. intersection D. product

Subtype

A narrowing conversion is an implicit conversion that may result in loss of data. T/F

True

A reference is the address of an object under control of the system, which cannot be used as a value or operated on in any way. T/F

True

A union is considered to be discriminated if a tag is added to the union to distinguish the type of the element. T/F

True

Ada has a completely safe union mechanism called a variant record. T/F

True

All computer data is finite. T/F

True

Casts are permitted on structured types if they have identical sizes in memory. T/F

True

Each type descriptor includes a field called a type for to identify the category of the data type. T/F

True

Explicit typing can be used to remove ambiguities in programs. T/F

True

For multidimensional array declarations must have all but the first dimension specified. T/F

True

For multidimensional arrays, the column-major form of allocation can be used only if all array indices must be specified together. T/F

True

Hindley-Milner type checking assigns type varaibles to all unnamed types. T/F

True

In Ada, simple data types are called scalar types. T/F

True

In C, types that are constructed using type constructors are called derived types. T/F

True

In C/C++, multidimensional array declaration must have all but the first dimension specified. T/F

True

In a strongly typed programming language, the set of legal programs is a proper subset of the set of safe programs. T/F

True

Pointers are often used in the creation of recursive types. T/F

True

Static type information allows compilers to allocate memory efficiently. T/F

True

Subset types inherit operations from their parent types. T/F

True

Enumerated types are never ordered. T/F

False

Every language comes with a set of predefined types from which all other types are constructed. T/F

False

Java does not allow dynamically sized arrays. T/F

False

Polymorphism allows names to have multiple types but does not allow for static type checking. T/F

False

Static type checking occurs at runtime. T/F

False

The type system is the naming convention for data types. T/F

False

If a type must be inferred by the translator, it is considered to be a(n) __ type. A. Explicit B. Strong C. Implicit D. Weak

Implicit

Type __ algorithms determine if two separately declared types are the same. A. Inference B. Equivalence C. Comparison D. Enforcing

Equivalence

Ada is a language with no explicit types. T/F

False

All data types must be names. T/F

False

__ types have no name A. Generic B. Anonymous C. Variable D. User-Defined

Anonymous

__ is a term used for the type correctness of assignments. A. Assignment Linking B. Value Assignment C. Assignment compatibility D. Backwards compatibility

Assignment compatibility

Explicit conversions are often referred to as __. A. Casts B. Coercions C. Narrowing conversions D. Widening conversions

Casts

Implicit conversion are often referred to as __. A. Type leaps B. Symbolic conversions C. Interpretive conversions D. Coercions

Coercions

Type __ are used to construct complex types from basic types. A. Constructors B. Assemblers C. Checkers D. Combiners

Constructors

To obtain the value of a location in memory referenced by a pointer, the pointer must be __. A. Dereferenced B. Linked C. Evaluated D. Product

Dereferenced

The primary data structure used to represent type attributes is called a type __. A. Definer B. Descriptor C. Constructor D. Enumerator

Descriptor

Ordinal data types in Ada are called __ types. A. Simple B. Scalar C. Composite D. Discrete

Discrete

If information is maintained and checked at runtime, the checking is __. A. Dynamic B. Static C. Referential D. Inferential

Dynamic

__ types are set whose elements are named and listed explicitly. A. List B. Array C. Enumerated D. Simple

Enumerated

The most general type possible for a polymorphic function with a given implementation is called its __ type. A. General B. Base C. Principal D. Specialized

Principal

A(n) __ type uses itself in its declaration. A. Bootstrap B. Recursive C. Reference D. Enumerated

Recursive

In Java, types constructed using type constructors are called __ types. A. Reference B. Simple C. Primitive D. Integral

Reference

When a structured type is cast, the translation merely __ the memory as a different type. A. Reallocates B. References C. Reinterprets D. Realigns

Reinterprets

Which of the following languages has no explicit types or translation-time typing? A. Ada B. Java C. C++ D. Scheme

Scheme

The process a translator goes through to determine whether the type information in a program is consistent is called type __ . A. Inference B. Constructing C. Equivalence D. Checking

inference

A data type is a(n) __? A. encoding form B. set of values C. style of storage D. group of location in memory

set of values

Languages without static type systems are usually called __ languages. A. reverse types B. untyped C. weakly typed D. strongly types

untyped


Related study sets

Supply Chain exam 1 (quizzes from cengage), MKG 360 Exam 1 Ch 2, intro to SCM chapter 1, MKG MOSER FIRST EXAM, Chapter 1: Introduction to Supply Chain Management : Chapter 1: Test, test 1 questions supply chain, Chapter 1: Operations and Supply Chain...

View Set

Freedmen's Bureau And KKK Practice Questions

View Set

Adaptive Quizzes- Chapter 52 Endocrine Disorders

View Set

Lugares de la Ciudad, Preposiciones/ubicación

View Set

CompTia A+ Practice Test 2 (1001)

View Set