4102 Chapter 3 & 4, 4102 Chapter 5, 4102 Chapter 7, 4102 Chapter 6, 4102 Chapter 2, 4102 chapter 1

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

In the Horn clause a1 and a2 and a3 ® b, the portion a1 and a2 and a3 is called the ____. Select one: a. head b. body c. tail d. query

Body

____ binding occurs during execution a. Rapid b. Static c. Value d. Dynamic

Dynamic

A pure functional program is one that consists only of functions and procedures. Select one: True False

False

Declarations in surrounding blocks are called nonlocal declarations. T/F

False

Every logical statement can be turned into Horn clauses. Select one: True False

False

Horn clauses cannot be given a procedural interpretation. Select one: True False

False

If an operator can be used to perform more than one operation, it is said to be shadowed. T/F

False

In C++, declarations that bind all potential attributes are called prototypes. T/F

False

Java requires manual deallocation of objects. T/F

False

Java uses assignment by cloning for all object variables. T/F

False

Lexical scoping rules are sometimes called dynamic scoping. T/F

False

Static binding occurs during execution. T/F

False

Static constants are always computed at load time. T/F

False

The declaration before use scoping rule in C allows any declaration to be used as long as it is declared within the current block. T/F

False

The existential quantifier is used to represent all things in the universe that exist. Select one: True False

False

The meaning of a name cannot be determined by the attributes associated with it. T/F

False

The semantics of Scheme uses static type checking. Select one: True False

False

____ are generally bound at load time. a. All variables b. All attributes c. Predefined identifiers d. Global variables

Global variables

Which of the following statements about Haskell is correct? Select one: a. Haskell is a fully curried and lazy language. b. Haskell is a fully curried language that does not do delayed evaluation. c. Haskell does not support higher-order functions. d. Haskell is a lazy language that is not fully curried.

Haskell is a fully curried and lazy language.

Most logic programming systems restrict themselves to a particular subset of predicate calculus called ____. Select one: a. algorithms b. axiomatic clauses c. Horn clauses d. control clauses

Horn clauses

____ declarations are associated with a specific block. a. Local b. General c. Global d. Specific

Local

Which of the following statements about lazy evaluation is incorrect? Select one: a. All arguments to user-defined functions are delayed. b. All arguments to constructor functions are delayed. c. Operations on lists must evaluate the entire list. d. All bindings of local names in let and letrec expressions are delayed.

Operations on lists must evaluate the entire list.

In Prolog, the cut operator is used to ____. Select one: a. remove a node from a tree b. move a node from one tree to another c. stop a search of a tree d. prune duplicates from a tree

Stop a search of a tree

Standard predefined resources for performing input and output in ML are contained in a ____. Select one: a. package b. structure c. class d. library

Structure

26 The unique structure of each application is referred to as an application framework. Select one: True False

The correct answer is 'False'.

30 Messages in Smalltalk that expect arguments are called parameterized messages. Select one: True False

The correct answer is 'False'.

36 C++ has built-in garbage collection. Select one: True False

The correct answer is 'False'.

45 In C++, instance variables and methods are both called descriptors. Select one: True False

The correct answer is 'False'.

46 Abstract classes are often instantiated by the application program. Select one: True False

The correct answer is 'False'.

50 In C++, objects can only be allocated on the heap. Select one: True False

The correct answer is 'False'.

A linker program is used to load machine code into computer memory. Select one: True False Feedback

The correct answer is 'False'.

A procedure is a function that returns a value to its caller. Select one: True False

The correct answer is 'False'.

A recognizer is a program that accepts or rejects strings based on whether they have occurred before. Select one: True False

The correct answer is 'False'.

A translator that executes a program directly is called a compiler. Select one: True False

The correct answer is 'False'.

Assembly language is standard across all types of computer hardware architectures. Select one: True False

The correct answer is 'False'.

C++ does not have a formal language definition. Select one: True False

The correct answer is 'False'.

C++ is an open source language that has never had a commercial release. Select one: True False

The correct answer is 'False'.

C++ was not intended to undergo incremental development. Select one: True False

The correct answer is 'False'.

FORTRAN was the first programming language to be machine independent. Select one: True False

The correct answer is 'False'.

In Java, scalar data types are objects for reasons of efficiency. Select one: True False

The correct answer is 'False'.

In a regular expression, curly braces are used to indicate a range of characters. Select one: True False

The correct answer is 'False'.

Java and Smalltalk both allocate objects directly onto the stack for efficiency. Select one: True False

The correct answer is 'False'.

Machine language consists of entering a series of hexadecimal codes into the computer. Select one: True False

The correct answer is 'False'.

Most modern languages are in a completely fixed format. Select one: True False

The correct answer is 'False'.

Predictive parsing allows tokens that begin optional parts of the syntax to also appear after the optional part. Select one: True False

The correct answer is 'False'.

Productions are in Backus-Naur form if they are given using only the metasymbols "<" and ">". Select one: True False

The correct answer is 'False'.

Referencing is the ability of a class to use the behavior and/or properties of classes above it in its hierarchy. Select one: True False

The correct answer is 'False'.

Reserved words, or keywords, are not considered to be a typical token category. Select one: True False

The correct answer is 'False'.

Resolution is an especially inefficient inference rule for Horn clauses. Select one: True False

The correct answer is 'False'.

Smalltalk uses value semantics, such that variables refer to an object's value. Select one: True False

The correct answer is 'False'.

The Haskell language requires semicolons and bracketing to resolve ambiguities. Select one: True False

The correct answer is 'False'.

The curly bracket { } notation used in extended Backus-Naur form stands for "at least one or more repetitions of." Select one: True False

The correct answer is 'False'.

The description of simple integer arithmetic expressions with addition and multiplication cannot be represented by a context-free grammar. Select one: True False

The correct answer is 'False'.

The ease with which a complex process or structure can be expressed in a programming language is called its regularity. Select one: True False

The correct answer is 'False'.

The first assembly languages appeared in the 1970s. Select one: True False

The correct answer is 'False'.

The kind of logic used in logic programming is lambda calculus. Select one: True False

The correct answer is 'False'.

The lexical structure of a programming language is similar to grammar in a natural language. Select one: True False

The correct answer is 'False'.

The most important design criterion of the last 25 years has been the goal of efficiency. Select one: True False

The correct answer is 'False'.

The syntax of a programming language refers to its meaning. Select one: True False

The correct answer is 'False'.

When a constructor calls another constructor, it is called constructor teaming. Select one: True False

The correct answer is 'False'.

When multiple inheritance is declared using the virtual keyword, separate copies of each class on an inheritance path are created. Select one: True False

The correct answer is 'False'.

Logical statements can be used as formal specifications for the required behavior of programs. Select one: True False

The correct answer is 'True'

27 C++ permits an object to be allocated either directly on the stack or as a pointer. Select one: True False

The correct answer is 'True'.

31 Multiple inheritance in C++ ordinarily creates separate copies of each class on an inheritance path. Select one: True False

The correct answer is 'True'.

32 Extending an object is one way that a software component can be modified for reuse. Select one: True False

The correct answer is 'True'.

37 Smalltalk provides a small set of binary messages that allow the programmer to write arithmetic and comparison expressions. Select one: True False

The correct answer is 'True'.

38 Abstraction is the collection of similar operations from two different components into a new component. Select one: True False

The correct answer is 'True'.

43 Smalltalk and Java require the use of a garbage collector to return inaccessible storage to the heap. Select one: True False

The correct answer is 'True'.

44 Public members are those accessible to client code as well as to derived classes. Select one: True False

The correct answer is 'True'.

A bottom-up parser constructs derivations and parse trees from the leaves to the root. Select one: True False

The correct answer is 'True'.

A conflict between syntax and semantics arises when languages require certain strings to be predefined identifiers rather than reserved words. Select one: True False

The correct answer is 'True'.

A grammar for which two distinct parse trees are possible for the same string is considered to be ambiguous. Select one: True False

The correct answer is 'True'.

A higher-order function returns a function as a value. Select one: True False

The correct answer is 'True'.

A left-recursive rule for an operation causes it to left-associate. Select one: True False

The correct answer is 'True'.

A programming language's words are referred to as tokens. Select one: True False

The correct answer is 'True'.

A structured control abstraction divides a program into groups of instructions. Select one: True False

The correct answer is 'True'.

A translator that produces an equivalent program in an executable form is called a compiler. Select one: True False

The correct answer is 'True'.

A virtual machine is an interpreter. Select one: True False

The correct answer is 'True'.

Abstract syntax trees abstract the essential structure of the parse tree. Select one: True False

The correct answer is 'True'.

All built-in classes in Smalltalk are subclasses of the Object class. Select one: True False

The correct answer is 'True'.

An abstraction is a way of expressing ideas that make them concise, simple, and easy for the human mind to grasp. Select one: True False

The correct answer is 'True'.

Backus-Naur forms are used to describe the syntax of programming languages such as Algol60. Select one: True False

The correct answer is 'True'.

Before the middle of the 1940s, computer operators hardwired their programs by setting switches that adjusted the internal wiring of the computer. Select one: True False

The correct answer is 'True'.

C++ member functions that are given implementations in a class declaration are automatically assumed to be inline. Select one: True False

The correct answer is 'True'.

C++ was designed to be a multiparadigm language that would not enforce any one style of programming. Select one: True False

The correct answer is 'True'.

Derivation is the process that replaces left-hand sides by choices of right-hand sides appearing in prior rules. Select one: True False

The correct answer is 'True'.

In C++, template classes can be used to define generic collections. Select one: True False

The correct answer is 'True'.

In Smalltalk, a message is a request for a service. Select one: True False

The correct answer is 'True'.

In extended Backus-Naur form, square brackets [ ] indicate optional parts of the syntax. Select one: True False

The correct answer is 'True'.

Irregularities in a language may be the result of maintaining backward compatibility with a prior version of the language. Select one: True False

The correct answer is 'True'.

Java is considered to be a semantically safe language. Select one: True False

The correct answer is 'True'.

Machine code was considered to be the first software. Select one: True False

The correct answer is 'True'.

Object-oriented programs consist of a set of objects that execute by acting and reacting to each other, much the same way that a real-world process proceeds. Select one: True False

The correct answer is 'True'.

One of the design goals of C++ was that it would be highly portable. Select one: True False

The correct answer is 'True'.

Ordinary syntax is sometimes called concrete syntax to distinguish it from abstract syntax. Select one: True False

The correct answer is 'True'.

Python was designed to bridge the gap between a systems language like C and a shell language like Perl. Select one: True False

The correct answer is 'True'.

Recursive-descent parsers turn the nonterminals into a group of mutually recursive procedures whose actions are based on the right-hand side of the BNFs. Select one: True False

The correct answer is 'True'.

Regular expressions can be used to describe tokens. Select one: True False

The correct answer is 'True'.

Shift-reduce parsers shift tokens onto a stack before reducing strings to nonterminals. Select one: True False

The correct answer is 'True'.

Specification languages would allow users to indicate their requirements and would then implement those requirements. Select one: True False

The correct answer is 'True'.

The ALGOL programming language provides support for recursive procedures. Select one: True False

The correct answer is 'True'.

The FORTRAN language provided support for algebraic notation and floating-point numbers. Select one: True False

The correct answer is 'True'.

The history of object-oriented programming languages begins in the 1960s with the Simula project. Select one: True False

The correct answer is 'True'.

The lambda calculus was based on the theory of recursive functions. Select one: True False

The correct answer is 'True'.

The lexical structure of a programming language is the structure of its tokens, or words. Select one: True False

The correct answer is 'True'.

The primary feature of an imperative language is a sequence of statements that represent commands. Select one: True False

The correct answer is 'True'.

The process of associating the semantics of a construct to its syntactic structure is called syntax-directed semantics. Select one: True False

The correct answer is 'True'.

The start symbol is used to identify the start of the grammar. Select one: True False

The correct answer is 'True'.

The syntax of a programming language is like the grammar of a natural language. Select one: True False

The correct answer is 'True'.

The use of variable names is considered to be a basic data abstraction. Select one: True False

The correct answer is 'True'.

White space is an example of a token delimiter. Select one: True False

The correct answer is 'True'.

Words or tokens are called terminals, since they cannot be broken down further. Select one: True False

The correct answer is 'True'.

____ was the first programming language to have a formal definition. Select one: a. ADA b. ALGOL c. Assembly language d. FORTRAN

The correct answer is: ALGOL

A ____ gives a programmer information about a resource's classes, methods, and functions. Select one: a. package b. library c. API d. component

The correct answer is: API

Of the following languages, which is a statically typed language? Select one: a. Lisp b. Python c. Ada d. Smalltalk

The correct answer is: Ada

Which of the following is an object-oriented language? Select one: a. C b. FORTRAN c. Algol d. C++

The correct answer is: C++

29 ____ binding is the binding of messages to methods based on the class of the receiver object. Select one: a. Automatic b. Adaptive c. Static d. Dynamic

The correct answer is: Dynamic

____ languages require all tokens to occur in prespecified locations on the page. Select one: a. Free-format b. Specified-format c. Precise-format d. Fixed-format

The correct answer is: Fixed-format

Which of the following is an example of lack of generality in a language? Select one: a. In Pascal, functions can return only scalar or pointer types as values. b. In C, local variables can only be defined at the beginning of a block. c. In C, arrays cannot be directly compared using the == operator. d. In Pascal, return statements in functions look like assignments to variables.

The correct answer is: In C, arrays cannot be directly compared using the == operator.

____ is an important need satisfied by object-oriented programming. Select one: a. Abstract data typing b. Rapid prototyping c. Program component dependence d. Independence of software components

The correct answer is: Independence of software components

Which of the following is a functional language? Select one: a. ALGOL b. Lisp c. Python d. FORTRAN

The correct answer is: Lisp

____ are symbols used to distinguish between parts of a rule. Select one: a. Distinguishers b. Abstract characters c. Metasymbols d. Identifiers

The correct answer is: Metasymbols

____ can belong to more than one class. Select one: a. Multimethods b. Supermethods c. Global methods d. Variable methods

The correct answer is: Multimethods

____ are phrase structures that are broken down into further phrase structures. Select one: a. Nonterminals b. Complex grammars c. Terminals d. Compressed structures

The correct answer is: Nonterminals

____ automatically translate a BNF description into a parser. Select one: a. Scanners b. Syntax generators c. Parser generators d. Shift-reduce parsers

The correct answer is: Parser generators

Which of the following statements about programming languages is correct? Select one: a. The Ada language is based on Prolog. b. Pascal is based on ALGOL. c. ALGOL was developed before FORTRAN. d. C language was developed before ALGOL.

The correct answer is: Pascal is based on ALGOL.

47 ____ is the use of the same names for messages requesting similar services from different classes. Select one: a. Overshadowing b. Polymorphism c. Generalization d. Distinction

The correct answer is: Polymorphism

____ have been given an initial meaning for all programs in the language but are capable of being redefined. Select one: a. Constants b. Global literals c. Keywords d. Predefined identifiers

The correct answer is: Predefined identifiers

All of the following languages are statically typed except ____. Select one: a. Ada b. C++ c. C d. Python

The correct answer is: Python

____ are descriptions of patterns of characters. Select one: a. Syntax diagrams b. Variable expressions c. Regular expressions d. Canonical diagrams

The correct answer is: Regular expressions

Which of the following is most closely related to reliability? Select one: a. Uniformity b. Security c. Generality d. Regularity

The correct answer is: Security

48 The first programming language to incorporate the object paradigm in a thorough and consistent way was ____. Select one: a. Simula67 b. Fortran-80 c. Algol60 d. Smalltalk-80

The correct answer is: Smalltalk-80

____ languages allow the user to enter the requirements for a program and have the system implement the requirements.. Select one: a. Imperative b. Definitive c. Specification d. Functional

The correct answer is: Specification

Which of the following statements about a programming language is correct? Select one: a. Semantics refers to the structure of the language, while abstraction refers to the meaning of the language. b. Syntax refers to the structure of the language, while abstraction refers to the meaning of the language. c. Syntax refers to the structure of the language, while semantics refers to the meaning of the language. d. Semantics refers to the structure of the language, while syntax refers to the meaning of the language.

The correct answer is: Syntax refers to the structure of the language, while semantics refers to the meaning of the language.

____ abstractions support information hiding. Select one: a. Unit data b. Structured control c. Basic data d. Structured data

The correct answer is: Unit data

The Smalltalk block object is enclosed in ____. Select one: a. [ ] b. c. < > d. { }

The correct answer is: [ ]

The first implementation of C++ used ____. Select one: a. a compiler named Cpre b. a compiler named Cfront c. a preprocessor named Cfront d. an interpreter named Cfront

The correct answer is: a compiler named Cfront

25 Java uses ____ to implement method lookup. Select one: a. a jump table b. polymorphism c. an inheritance tree d. restricted access

The correct answer is: a jump table

In a regular expression, repetition is indicated by ____. Select one: a. an asterisk b. a vertical bar c. a hyphen d. an exclamation mark

The correct answer is: an asterisk

A variable in a programming language is considered to be a ____. Select one: a. basic data abstraction b. basic control abstraction c. structured control abstraction d. structured data abstraction

The correct answer is: basic data abstraction

An object in Smalltalk that contains code is called a ____. Select one: a. snippet b. routine c. module d. block

The correct answer is: block

In a program, selection and iteration are accomplished by the use of ____. Select one: a. syntactic sugar b. application programming interfaces c. branch instructions d. structured data abstractions

The correct answer is: branch instructions

A ____ message is sent to a class in Smalltalk. Select one: a. constructor b. control c. object d. class

The correct answer is: class

A ____ takes source code as input and translates it into a program that is executable. Select one: a. interpreter b. compiler c. loader d. linker

The correct answer is: compiler

35 Applications normally create and manipulate instances of ____ classes in Smalltalk. Select one: a. abstract b. physical c. concrete d. final

The correct answer is: concrete

Variables are given names and data types using a ____. Select one: a. declaration b. function c. package d. structure

The correct answer is: declaration

23 In Java, the ____ constructor takes no parameters. Select one: a. overloaded b. default c. chained d. base

The correct answer is: default

39 C++ includes ____, which specify how to deallocate memory for objects. Select one: a. garbage collectors b. deallocators c. erasers d. destructors

The correct answer is: destructors

A ____ rule must be stated to overcome ambiguous grammars. Select one: a. clarifying b. overriding c. specifying d. disambiguating Feedback

The correct answer is: disambiguating

A grammar is considered to be context-free if ____. Select one: a. each terminal can be replaced by any right-hand side choice, no matter where it appears b. each nonterminal can be replaced by any right-hand side choice, no matter where it appears c. the grammar also expresses the semantics of the language d. context strings appear on the left-hand sides of grammar rules

The correct answer is: each nonterminal can be replaced by any right-hand side choice, no matter where it appears

The irregularities of primitive types and reference types in Java is the result of the designer's concern with ____. Select one: a. generality b. regularity c. orthogonality d. efficiency

The correct answer is: efficiency

Which of the following properties is least exhibited by Python? Select one: a. simplicity b. portability c. extensibility d. efficiency

The correct answer is: efficiency

42 Restricting access to internal details of software components is known as ____. Select one: a. polymorphism b. abstraction c. encapsulation d. redefinition

The correct answer is: encapsulation

A language that allows the user to add features to it is said to have the property of ____. Select one: a. reliability b. regularity c. uniformity d. extensibility

The correct answer is: extensibility

A language is considered to be ____ when format has no effect on the program structure (other than to satisfy the principle of longest substring). Select one: a. free-format b. fixed format c. loose-format d. open-format

The correct answer is: free-format

Lisp is based on the ____ model of computation. Select one: a. semantic b. interpretive c. functional d. imperative

The correct answer is: functional

Java uses ____ to deallocate objects that are no longer needed. Select one: a. memory functions b. destructors c. garbage collection d. scope resolution

The correct answer is: garbage collection

A language achieves ____ by avoiding special cases in the use of constructs. Select one: a. orthogonality b. efficiency c. uniformity d. generality

The correct answer is: generality

The fact that Pascal does not allow functions and procedures to be assigned to variables indicates a lack of ____ in the language. Select one: a. generality b. uniformity c. orthogonality d. efficiency

The correct answer is: generality

A context-free grammar consists of a series of ____. Select one: a. grammar rules b. positional rules c. semantic rules d. algebraic expressions

The correct answer is: grammar rules

The real benefit of deferring type checking until runtime is ____. Select one: a. greater runtime efficiency b. greater programmer efficiency c. higher program reliability d. higher program safety

The correct answer is: greater programmer efficiency

A map is an example of a ____. Select one: a. API b. iterator c. higher-order function d. procedure

The correct answer is: higher-order function

A function is considered to be ____ if a compiler may replace the function call by the actual code for the function. Select one: a. redirectable b. inline c. substitutable d. virtual

The correct answer is: inline

41 In Smalltalk, an object's ____ is the set of messages it recognizes. Select one: a. listener set b. interface c. operator list d. command list

The correct answer is: interface

C++ ____. Select one: a. does not have an accepted set of standards b. is a functional type language c. is an object-oriented language d. is not widely used

The correct answer is: is an object-oriented language

Python is easy for nonprogrammers to learn and use because ____. Select one: a. it has a very rich set of data types b. it is highly portable to multiple platforms c. it is based on a small but powerful set of primitive operations and data types that can be easily extended d. it does not support advanced abstractions

The correct answer is: it is based on a small but powerful set of primitive operations and data types that can be easily extended

A ____ is an object associated with a collection, and is used to visit each element in the collection. Select one: a. iterator b. invocator c. interpreter d. argument

The correct answer is: iterator

Abstractions can be categorized in terms of ____, which can be viewed as measures of the amount of information contained (and hidden) in the abstraction. Select one: a. levels b. statements c. procedures d. protocols

The correct answer is: levels

The principle of ____ takes the longest possible string of nonblank characters into a single token. Select one: a. greatest aggregate b. longest substring c. maximized grouping d. multipass parsing

The correct answer is: longest substring

The use of a single token to direct a parse is called single-symbol ____. Select one: a. interpretation b. directives c. prediction d. lookahead

The correct answer is: lookahead

A ____ specifies the syntax of a piece of code that expands to other standard code. Select one: a. macro b. compiler c. function d. procedure

The correct answer is: macro

In Smalltalk, the object that receives a message performs its service by invoking an appropriate ____. Select one: a. sub-routine b. function c. method d. procedure

The correct answer is: method

51 In Smalltalk, messages that result in the change of state in the receiver are called ____. Select one: a. modifiers b. adjustors c. mutators d. relays

The correct answer is: mutators

The ____ programming paradigm has achieved widespread use over the last 20 years. Select one: a. logic b. object-oriented c. functional d. assembler

The correct answer is: object-oriented

A language is said to have the property of ____ if its constructs can be combined in any meaningful way, with no unexpected restrictions. Select one: a. efficiency b. uniformity c. generality d. orthogonality

The correct answer is: orthogonality

The fact that C does not allow array types to be the return value of a function indicates a lack of ____ in the language. Select one: a. orthogonality b. generality c. uniformity d. efficiency

The correct answer is: orthogonality

A ____ is the standard graphical depiction of syntax-directed semantics. Select one: a. UML diagram b. flow chart c. chained list d. parse tree

The correct answer is: parse tree

During the ____ phase, the translator processes the tokens, determining the program's syntactic structure. Select one: a. scanning b. implementation c. parsing d. generation

The correct answer is: parsing

The purpose of a ____ is to apply grammar rules to a source program and report syntax or lexical errors, without performing any additional analysis. Select one: a. reducing shells b. verifying shells c. parsing shell d. interpreter

The correct answer is: parsing shell

A requirement that a sentence must start with a capitalized letter is an example of a ____. Select one: a. nonterminal b. grammar rule c. terminal d. positional property

The correct answer is: positional property

A parser that commits itself to a particular action based only on a lookahead is called a ____ parser. Select one: a. exhaustive b. insightful c. foresight d. predictive

The correct answer is: predictive

In Java, scalar data types are also called ____ types. Select one: a. quantitative b. simple c. primitive d. flexible

The correct answer is: primitive

Grammar rules are also called ____. Select one: a. instructions b. documentation c. productions d. compilations

The correct answer is: productions

49 In C++, ____ members are accessible by derived classes. Select one: a. protected b. extensible c. private d. restricted

The correct answer is: protected

The simplest form of a parser is a ____. Select one: a. recognizer b. interpreter c. compiler d. translator

The correct answer is: recognizer

When a language's variables refer to objects, we say that the language uses ____ semantics. Select one: a. value b. abstract c. reference d. object

The correct answer is: reference

A programming language's expressiveness ____. Select one: a. refers to its level of generality b. refers to the efficiency of the code c. refers to how well its features are integrated d. refers to how easy it is to express complex processes

The correct answer is: refers to how easy it is to express complex processes

The processing of white space is generally handled by a ____. Select one: a. predictive parser b. scanner c. parser d. parser generator

The correct answer is: scanner

During its ____ phase, a translator collects sequences of characters from the input program and forms them into tokens. Select one: a. scanning b. parsing c. generating d. analyzing

The correct answer is: scanning

Python was originally designed for ____. Select one: a. expert programmers b. scientists and engineers and other non-programmers c. large scale systems d. time-critical systems

The correct answer is: scientists and engineers and other non-programmers

Member functions can be implemented outside the declaration of a class in C++ using the ____ operator. Select one: a. redirection b. scope resolution c. scope altering d. directive

The correct answer is: scope resolution

A language which prevents a programmer from compiling or executing any statements or expressions that violate the definition of the language is said to be ____. Select one: a. uniform b. orthogonal c. efficient d. semantically safe

The correct answer is: semantically safe

The lexical structure of a programming language is similar to the ____ in a natural language Select one: a. syntax b. grammar c. spelling d. semantics

The correct answer is: spelling

A context-free grammar has a special nonterminal called the ____ symbol which stands for the entire top-level phrase being defined. Select one: a. abstract b. start c. initial d. forward

The correct answer is: start

Attempts to make programming languages more reliable led to the development of ____. Select one: a. better documentation b. strong data typing c. improved writability d. increased efficiency

The correct answer is: strong data typing

An iterator is an example of a ____. Select one: a. structured control abstraction b. basic control abstraction c. basic data abstraction d. structured data abstraction

The correct answer is: structured control abstraction

A text file is considered to be a ____. Select one: a. structured data abstraction b. basic data abstraction c. structured control abstraction d. basic control abstraction

The correct answer is: structured data abstraction

An array is considered to be a ____. Select one: a. basic data abstraction b. basic control abstraction c. structured data abstraction d. unit abstraction

The correct answer is: structured data abstraction

An enhanced for loop is an example of a ____. Select one: a. syntactic sugar b. basic data abstraction c. basic control abstraction d. collection Feedback

The correct answer is: syntactic sugar

The term ____ refers to a programming language mechanism that replaces a complex notation with a simpler notation. Select one: a. API b. shorthand c. semantic sugar d. syntactic sugar

The correct answer is: syntactic sugar

28 In C++, a pure virtual declaration is a function declared with the keyword virtual and ____. Select one: a. parentheses b. the keyword null c. the keyword void d. a pointer

The correct answer is: the keyword void

The lexical structure of a programming language is the structure of its ____. Select one: a. variables b. comments c. tokens d. references

The correct answer is: tokens

40 In Smalltalk, ____ messages expect no arguments. Select one: a. inquisitive b. redirecting c. unary d. single

The correct answer is: unary

A language is said to have the property of ____ if it has a design in which similar things look similar, and different things look different. Select one: a. efficiency b. generality c. uniformity d. orthogonality

The correct answer is: uniformity

Because C++ requires a semicolon after a class definition but not after a function definition, C++ is said to lack ____. Select one: a. reliability b. orthogonality c. uniformity d. security

The correct answer is: uniformity

A class is considered to be a ____. Select one: a. basic control abstraction b. structured data abstraction c. unit abstraction d. basic data abstraction

The correct answer is: unit abstraction

Threads in Java are an example of ____. Select one: a. basic control abstractions b. unit control abstractions c. basic data abstractions d. structured control abstractions

The correct answer is: unit control abstractions

The ____ abstraction is often associated with the concept of an abstract data type. Select one: a. structured control b. unit data c. basic data d. structured data

The correct answer is: unit data

A module, a class, and a package are all examples of ____ Select one: a. structured data abstractions b. structured control abstractions c. unit data abstractions d. basic data abstractions

The correct answer is: unit data abstractions

Which of the following is not considered to be a token category? Select one: a. literal b. reserved word c. white space d. identifier

The correct answer is: white space

The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called _____. Select one: a. orthogonality b. efficiency c. regularity d. writability

The correct answer is: writability

A block consists of a sequence of declarations followed by a sequence of statements. T/F

True

A fundamental abstraction mechanism in any programming language is the use of names, or identifiers to denote language entities or constructs. T/F

True

A logic programming language is a notational system for writing logical statements together with specified algorithms for implementing inference rules. Select one: True False

True

A translator's symbol table stores the mappings between names and attributes. T/F

True

An example of a Horn clause is a1 and a2 and a3 ® b. Select one: True False

True

Any scoping structure that can be referenced directly in a language must have its own symbol table. T/F

True

Binding time refers to when an attribute is computed and bound to a name. T/F

True

Dangling references are locations that have been deallocated from the environment but can still be accessed by a program. T/F

True

Declaration visibility includes only those regions of a program where the bindings of the declaration apply. T/F

True

Each function call generates a region of allocated memory associated with the function; this is called an activation record. T/F

True

Haskell supports a type class inheritance through a hierarchy of type classes. Select one: True False

True

In C, blocks are called compound statements. T/F

True

In a block-structured language with heap allocation, there are three kinds of allocation: static (for global variables), automatic (for local variables), and dynamic (for heap allocation). T/F

True

Locations are places where values can be stored. T/F

True

Logical statements can be either true or false. Select one: True False

True

Names can be bound to attributes prior to translation time, as in the case of predefined identifiers. T/F

True

Names can be reused within nested blocks by associating each declaration with a level number and an offset. T/F

True

Statements that can be derived from the logic program are known as queries or goals. Select one: True False

True

The lifetime of an object is the duration of its allocation in the environment. T/F

True

The process of unification can be used to shorten clauses. Select one: True False

True

Theorems are derived from axioms. Select one: True False

True

When a nonlocal name is used in an expression, the declaration that applies to that name cannot be determined until execution time under dynamic scoping. T/F

True

To define a value in the ML programming language, use the ____ keyword. Select one: a. val b. define c. letrec d. let

Val

____ are any storable quantities, such as integers. a. Values b. Identifiers c. Data d. Locations

Values

A pointer is an object whose stored value is a ____. a. activation record b. direction c. compound value d. reference to another object

a. reference to another object

Each call to a method is referred to as a ____. a. activation b. branching c. execution d. invocation

activation

In C, the ____ operator retrieves the address of a variable as a pointer. a. dereference b. allocation c. address of d. reference

address of

A ____ occurs when the same object is bound to two different names at the same time. a. duplicate b. multi-reference c. alias d. conflict

alias

The Scheme evaluation rule represents ____ evaluation. Select one: a. applicative order b. sequential order c. binary order d. normal order

applicative order

The semantics of programming language constructs is called ____. a. syntax b. axiomatic semantics c. specifications d. logic statements

axiom semantics

In the Haskell language, the ____ character represents the lambda. Select one: a. backslash b. underscore c. ampersand d. vertical bar

backslash

In object-oriented languages such as Java and Smalltalk, the ____ is the only declaration that does not itself need to be inside another class declaration. a. file b. module c. package d. class

class

The specific path that an automatic deduction system chooses to derive a statement is the ____ for a logic programming system. Select one: a. control problem b. theorem c. axiom d. deductive database

control problem

Assignment by sharing works by ____. a. accessing shared memory b. duplicating memory addresses c. copying the location of the first variable to the second d. copying the value to a new location

copying the location of the first variable to the second

24 To avoid repeated inheritance, one must ____. Select one: a. declare the inheritance using the virtual keyword b. use a private inner class c. use an inherited function d. declare the inheritance using the shared keyword

declare the inheritance using the virtual keyword

Logic programming systems are sometimes referred to as ____. Select one: a. logic queries b. deductive databases c. derivative databases d. successional databases

deductive database

In C++, declarations that bind all potential attributes are called ____. a. symbols b. prototypes c. explicits d. definitions

definitions

The bindings of names to storage locations is called the ____. a. environment b. compiler c. symbol table d. translator

environment

In lambda calculus, a conversion that allows for the elimination of redundant lambda abstractions is call ____. a. beta-conversion b. eta-conversion c. alpha-conversion d. beta-abstraction

eta-conversion

Language systems that automatically reclaim garbage are said to perform ____. a. recycling b. garbage collection c. memory reallocation d. memory reclamation

garbage collection

In C, the scope of a binding is limited to the block in which its associated declaration appears. This scoping rule is called ____ scope. a. lexical b. block c. package d. namespace

lexical

The ____ is the level number and offset of a declared name. a. lexical address b. explicit address c. compound address d. block address

lexical address

The body of an externally defined function will not be bound until ____. a. load time b. link time c. translation time d. execution time

link time

The set of logical statements that are taken to be axioms can be viewed as the ____. Select one: a. theorem b. logic program c. control statement d. baseline

logic program

A ____ constant is a name for a literal. a. manifest b. static c. compile-time d. symbolic

manifest

Garbage is defined as ____. a. variables with duplicate values b. a collection of unused variables c. memory that has been allocated in the environment but that has become inaccessible to the program d. a collection of unused constants

memory that has been allocated in the environment but that has become inaccessible to the program

The definition of a language using an interpreter written in the same language is called a ____.

metacircular interpreter

The closed-world assumption is that all solutions ____ or are assumed false. Select one: a. must be limited to a closed solution set b. must be rational c. must be finite d. must be proved true

must be proved true

Dynamic allocation places variables ____. a. on the heap b. in the pointer list c. on the stack d. in the symbol table

on the heap

If an operator performs more than one function it is said to be ____. a. shadowed b. implicit c. overloaded d. variable

overloaded

To express symbols as a data type in Scheme, use the keyword ____.

quote

Nonmonotonic reasoning is that adding information to a system can ____. Select one: a. decrease the complexity b. reduce the number of things that can be proved c. alter the previous information d. change the order of execution

reduce the number of things that can be proved

A variable declared locally within a block is said to ____ a global variable of the same name. a. shadow b. mirror c. occlude d. override

shadow

When a change in the value of a variable persists beyond the execution of a statement, a ____ has occurred. a. error b. side effect c. compound change d. persistent effect

side effect

The scope of a binding is ____. a. the region over which the binding is maintained b. the precision of the binding c. the magnitude of the binding d. the time when the binding takes place

the region over which the binding is maintained

Horn clauses can be viewed as specifications of procedures rather than strictly as implementations. Select one: True Fals

true

Programs known as automatic deduction systems ____.

turn proofs into computation

Programs known as automatic deduction systems ____. Select one: a. turn proofs into computation b. determine equality c. make choices based on input data d. solve logic questions

turn proofs into computation

The ____ character in ML indicates a wildcard. Select one: a. hyphen b. question mark c. asterisk d. underscore

underscore

Prolog uses ____.

uppercase for variable names, and lowercase for constants and functions

The bindings of ____ to storage locations is called the memory. a. names b. attributes c. values d. identifiers

values

A ____ is an object whose stored value can change during execution. a. method b. variable c. pointer d. class

variable

In predicate calculus, arguments to predicates and functions can only be terms - that is, combinations of ____. Select one: a. predicates, quantifiers, and connectives b. constants and predicates c. variables, constants, and functions d. predicates and connectives

variables, constants, and functions

The ____ character is used for alternative values in the ML programming language. Select one: a. underscore b. percent sign c. vertical bar d. ampersand

vertical bar


संबंधित स्टडी सेट्स

commercial package policy (property)

View Set

Financial Ratios Rough Guidelines

View Set

Agile Scrum Foundation Certification Prep

View Set

Relational Database Fundamentals

View Set