Programming Languages
Given a list L in Scheme with contents of (3 7 2 8). What will be returned if the command (cdr L) is executed?
(7 2 8)
____ was the first programming language to have a formal definition.
ALGOL
A(n) ____ gives a programmer information about a resource's classes, methods, and functions.
API
Of the following languages, which is a statically typed language? a. Python b. Lisp c. Smalltalk d. Ada
Ada
____ are statements that are assumed to be true and from which other true statements can be proved.
Axioms
Which of the following is an object-oriented language? a. C++ b. C c. FORTRAN d. Algol
C++
____ takes the perspective that a program describes what the solution to a problem is, not how that problem is solved.
Declarative programming
____ binding is the binding of messages to methods based on the class of the receiver object.
Dynamic
____ binding occurs during execution a. Rapid b. Static c. Value d. Dynamic
Dynamic
____ Prolog was used as the basis for the Prolog ISO standard.
Edinburgh
____ is an important need satisfied by object-oriented programming.
Independence of software components
What is the purpose of a binding list in Scheme?
It binds variable names to values.
Which of the following is a functional language? a. Lisp b. Algol c. Python d. FORTRAN
Lisp
____ declarations are associated with a specific block.
Local
____ are symbols used to distinguish between parts of a rule.
Metasymbols
____ can belong to more than one class.
Multimethods
____ are phrase structures that are broken down into further phrase structures.
Nonterminals
Which of the following statements about programming languages is correct? a) C language was developed before ALGOL. b) ALGOL was developed before FORTRAN. c) The Ada language is based on Prolog. d) Pascal is based on ALGOL.
Pascal is based on ALGOL.
____ is the use of the same names for messages requesting similar services from different classes.
Polymorphism
____ have been given an initial meaning for all programs in the language but are capable of being redefined.
Predefined identifiers
All of the following languages are statically typed except ____. a. Ada b. C c. C++ d. Python
Python
____ are descriptions of patterns of characters.
Regular expressions
Which of the following is most closely related to reliability?
Security
The first programming language to incorporate the object paradigm in a thorough and consistent way was ____.
Smalltalk-80
____ languages allow the user to enter the requirements for a program and have the system implement the requirements..
Specification
____ is the process of pattern matching to make statements identical.
Unification
____ abstractions support information hiding. Select one: a. Unit data b. Structured control c. Basic data d. Structured data
Unit data
____ are any storable quantities, such as integers.
Values
If the ML command val h::t = [4 5 6]; is executed, what value will t have?
[2 3]
The first implementation of C++ used ____.
a compiler named Cfront
Java uses ____ to implement method lookup.
a jump table
Which of the following is an example of lack of generality in a language? a. In C, arrays cannot be directly compared using the == operator. b. In Pascal, functions can return only scalar or pointer types as values. c. In C, local variables can only be defined at the beginning of a block. d. In Pascal, return statements in functions look like assignments to variables.
a. In C, arrays cannot be directly compared using the == operator.
Which of the following statements about lazy evaluation is incorrect? a. Operations on lists must evaluate the entire list. b. All arguments to user-defined functions are delayed. c. All arguments to constructor functions are delayed. d. All bindings of local names in let and letrec expressions are delayed.
a. Operations on lists must evaluate the entire list.
Which of the following statements about Scheme is correct? a. Scheme function applications use pass by value, while special forms in Scheme use delayed evaluation. b. Scheme function applications use pass by name, while special forms in Scheme use delayed evaluation. c. Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation. d. Scheme special forms use pass by value, while function applications in Scheme use delayed evaluation.
a. Scheme function applications use pass by value, while special forms in Scheme use delayed evaluation.
The Smalltalk block object is enclosed in ____. Select one: a. [ ] b. ( ) c. < > d. { }
a. [ ]
Each call to a method is referred to as a ____. a. activation b. branching c. execution d. invocation
a. activation
In C, the ____ operator retrieves the address of a variable as a pointer.
address of
A(n) ____ occurs when the same object is bound to two different names at the same time.
alias
In a regular expression, repetition is indicated by ____.
an asterisk
The Scheme evaluation rule represents ____ evaluation.
applicative order
The semantics of programming language constructs is called ____.
axiomatic semantics
In the Haskell language, the ____ character represents the lambda.
backslash
A variable in a programming language is considered to be a ____.
basic data abstraction
An object in Smalltalk that contains code is called a ____.
block
In the Horn clause a1 and a2 and a3 → b, the portion a1 and a2 and a3 is called the ____.
body
In a program, selection and iteration are accomplished by the use of ____.
branch instructions
Which of the following represents a list of data in Scheme? a. (3.1, 3.2, 3.3) b. (3.1; 3.2; 3.3) c. (quote (3.1 3.2 3.3)) d. (quote (3.1, 3.2, 3.3))
c. (quote (3.1 3.2 3.3))
Which of the following statements about scoping in Scheme is correct? a. A bound variable is a variable referenced within a function that is not also a formal parameter to that function. b. A free variable is a variable within a function that is also a formal parameter to that function. c. A free variable is a variable referenced within a function that is not also a formal parameter to that function. d. A free variable is one that is bound within a nested function.
c. A free variable is a variable referenced within a function that is not also a formal parameter to that function.
Which of the following statements is correct? a. A language with nonstrict functions is easier to implement. b. A function that will produce well-defined results, even when subexpressions or parameters may be undefined, is said to be strict. c. Delayed execution can lead to well-defined results, even when subexpressions or parameters may be undefined. d. Nonstrictness is always an undesirable property in a language.
c. Delayed execution can lead to well-defined results, even when subexpressions or parameters may be undefined.
Which of the following statements about Haskell is correct? a. Haskell is a lazy language that is not fully curried. b. Haskell is a fully curried language that does not do delayed evaluation. c. Haskell is a fully curried and lazy language. d. Haskell does not support higher-order functions.
c. Haskell is a fully curried and lazy language.
Which of the following represents a list in ML? a. (1 2 3) b. {1 2 3} c. [1, 2, 3] d. (1, 2, 3)
c. [1, 2, 3]
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
c. copying the location of the first variable to the second
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
c. stop a search of a tree
A(n) ____ message is sent to a class in Smalltalk.
class
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.
class
A(n) ____ takes source code as input and translates it into a program that is executable.
compiler
Applications normally create and manipulate instances of ____ classes in Smalltalk.
concrete
The specific path that an automatic deduction system chooses to derive a statement is the ____ for a logic programming system.
control problem
A grammar is considered to be context-free if ____.
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 ____.
efficiency
Which of the following properties is least exhibited by Python? a. simplicity b. portability c. extensibility d. efficiency
efficiency
Restricting access to internal details of software components is known as ____.
encapsulation
The bindings of names to storage locations is called the ____.
environment
In lambda calculus, a conversion that allows for the elimination of redundant lambda abstractions is call ____.
eta-conversion
A(n) ____ quantifier states that a predicate is true of at least one thing in the universe, indicated by the variable.
existential
A language that allows the user to add features to it is said to have the property of ____.
extensibility
Horn clauses of the form →b are sometimes referred to as ____.
facts
To force Prolog to perform loops and repetitive searches, we must force backtracking even when a solution is found by using the built-in predicate ____.
fail
A language is considered to be ____ when format has no effect on the program structure (other than to satisfy the principle of longest substring).
free-format
Lisp is based on the ____ model of computation.
functional
Language systems that automatically reclaim garbage are said to perform ____.
garbage collection
garbage collectionJava uses ____ to deallocate objects that are no longer needed.
garbage collection
A language achieves ____ by avoiding special cases in the use of constructs.
generality
The fact that Pascal does not allow functions and procedures to be assigned to variables indicates a lack of ____ in the language.
generality
A context-free grammar consists of a series of ____.
grammar rules
The real benefit of deferring type checking until runtime is ____.
greater programmer efficiency
In the Horn clause a1 and a2 and a3 → b, the variable b is called the ____.
head
A map is an example of a(n) ____.
higher-order function
A function is considered to be ____ if a compiler may replace the function call by the actual code for the function.
inline
Variables set equal to patterns are said to be ____.
instantiated
In Smalltalk, an object's ____ is the set of messages it recognizes.
interface
To force evaluation of an arithmetic term in Prolog, you must use the built-in predicate ____.
is
19. C++ ____.
is an object-oriented language
Python is easy for nonprogrammers to learn and use because ____.
it is based on a small but powerful set of primitive operations and data types that can be easily extended
A(n) ____ is an object associated with a collection, and is used to visit each element in the collection.
iterator
The ____ is used in Scheme to create a function.
lambda special form
Abstractions can be categorized in terms of ____, which can be viewed as measures of the amount of information contained (and hidden) in the abstraction.
levels
In C, the scope of a binding is limited to the block in which its associated declaration appears. This scoping rule is called ____ scope.
lexical
The ____ is the level number and offset of a declared name.
lexical address
The body of an externally defined function will not be bound until ____.
link time
The set of logical statements that are taken to be axioms can be viewed as the ____.
logic program
The principle of ____ takes the longest possible string of nonblank characters into a single token.
longest substring
The use of a single token to direct a parse is called single-symbol ____.
lookahead
A ____ specifies the syntax of a piece of code that expands to other standard code.
macro
A ____ constant is a name for a literal.
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
T or F: The definition of a language using an interpreter written in the same language is called a ____.
metacircular interpreter
In Smalltalk, the object that receives a message performs its service by invoking an appropriate ____.
method
The closed-world assumption is that all solutions ____ or are assumed false.
must be proved true
In Smalltalk, messages that result in the change of state in the receiver are called ____.
mutators
The ____ programming paradigm has achieved widespread use over the last 20 years.
object-oriented
Dynamic allocation places variables ____.
on the heap
A language is said to have the property of ____ if its constructs can be combined in any meaningful way, with no unexpected restrictions.
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.
orthogonality
If an operator performs more than one function it is said to be ____.
overloaded
In C++, a pure virtual declaration is a function declared with the keyword virtual and ____.
parentheses
A ____ is the standard graphical depiction of syntax-directed semantics.
parse tree
During the ____ phase, the translator processes the tokens, determining the program's syntactic structure.
parsing
The purpose of a(n) ____ is to apply grammar rules to a source program and report syntax or lexical errors, without performing any additional analysis.
parsing shell
A requirement that a sentence must start with a capitalized letter is an example of a ____.
positional property
A parser that commits itself to a particular action based only on a lookahead is called a(n) ____ parser.
predictive
In Java, scalar data types are also called ____ types.
primitive
Grammar rules are also called ____.
productions
In C++, ____ members are accessible by derived classes.
protected
To express symbols as a data type in Scheme, use the keyword ____.
quote
The simplest form of a parser is a(n) ____.
recognizer
Nonmonotonic reasoning is that adding information to a system can ____.
reduce the number of things that can be proved
In lambda calculus, a value can be substituted for a variable by use of a(n) ____.
reduction rule
When a language's variables refer to objects, we say that the language uses ____ semantics.
reference
A pointer is an object whose stored value is a(n) ____.
reference to another object
A programming language's expressiveness ____.
refers to how easy it is to express complex processes
The processing of white space is generally handled by a ____.
scanner
During its ____ phase, a translator collects sequences of characters from the input program and forms them into tokens.
scanning
Python was originally designed for ____.
scientists and engineers and other non-programmers
Member functions can be implemented outside the declaration of a class in C++ using the ____ operator.
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 ____.
semantically safe
A variable declared locally within a block is said to ____ a global variable of the same name.
shadow
When a change in the value of a variable persists beyond the execution of a statement, a(n) ____ has occurred.
side effect
The lexical structure of a programming language is similar to the ____ in a natural language
spelling
A list is written in Prolog using ____ to enclose the items.
square brackets
A context-free grammar has a special nonterminal called the ____ symbol which stands for the entire top-level phrase being defined.
start
Attempts to make programming languages more reliable led to the development of ____.
strong data typing
Standard predefined resources for performing input and output in ML are contained in a ____.
structure
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
structured control abstraction
A text file is considered to be a ____.
structured data abstraction
An array is considered to be a ____.
structured data abstraction
An enhanced for loop is an example of a ____.
syntactic sugar
The term ____ refers to a programming language mechanism that replaces a complex notation with a simpler notation.
syntactic sugar
The scope of a binding is ____.
the region over which the binding is maintained
The lexical structure of a programming language is the structure of its ____.
tokens
Programs known as automatic deduction systems ____.
turn proofs into computation
In Smalltalk, ____ messages expect no arguments.
unary
The ____ character in ML indicates a wildcard. Select one: a. hyphen b. question mark c. asterisk d. underscore
underscore
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.
uniformity
Because C++ requires a semicolon after a class definition but not after a function definition, C++ is said to lack ____.
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
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
unit control abstractions
The ____ abstraction is often associated with the concept of an abstract data type.
unit data
A module, a class, and a package are all examples of ____
unit data abstractions
The ____ quantifier represents all things in the universe named by the variable.
universal
Prolog uses ____.
uppercase for variable names, and lowercase for constants and functions
To define a value in the ML programming language, use the ____ keyword.
val
The bindings of ____ to storage locations is called the memory.
values
A ____ is an object whose stored value can change during execution.
variable
In predicate calculus, arguments to predicates and functions can only be terms — that is, combinations of ____.
variables, constants, and functions
The ____ character is used for alternative values in the ML programming language.
vertical bar
Which of the following is not considered to be a token category? a. reserve word b. identifier c. literal d. white space
white space
The quality of a language that allows a programmer to express a computation clearly, correctly, concisely, and quickly is called _____.
writability
T or F: Scheme expressions that begin with keywords are called control forms.
F
T or F: Smalltalk uses value semantics, such that variables refer to an object's value.
F
T or F: Static binding occurs during execution.
F
T or F: Static constants are always computed at load time.
F
T or F: The Haskell language requires semicolons and bracketing to resolve ambiguities.
F
T or F: The ISO standard for Prolog standardized the responses from a Prolog interpreter.
F
T or F: The curly bracket { } notation used in extended Backus-Naur form stands for "at least one or more repetitions of."
F
T or F: The declaration before use scoping rule in C allows any declaration to be used as long as it is declared within the current block.
F
T or F: The description of simple integer arithmetic expressions with addition and multiplication cannot be represented by a context-free grammar.
F
T or F: The ease with which a complex process or structure can be expressed in a programming language is called its regularity.
F
T or F: The essential construct of lambda calculus is called the lambda application.
F
T or F: The existential quantifier is used to represent all things in the universe that exist.
F
T or F: The first assembly languages appeared in the 1970s.
F
T or F: The kind of logic used in logic programming is lambda calculus.
F
T or F: The lexical structure of a programming language is similar to grammar in a natural language.
F
T or F: The meaning of a name cannot be determined by the attributes associated with it.
F
T or F: The most important design criterion of the last 25 years has been the goal of efficiency.
F
T or F: The rand function is referentially transparent.
F
T or F: The semantics of Scheme uses static type checking.
F
T or F: The syntax of a programming language refers to its meaning.
F
T or F: When a constructor calls another constructor, it is called constructor teaming.
F
T or F: When applied to data types, value semantics means that assignment produces two references to the same object.
F
T or F: When multiple inheritance is declared using the virtual keyword, separate copies of each class on an inheritance path are created.
F
T or F: When no type errors are caught during execution, we can infer that they do not exist.
F
T or F: With static scoping, the meaning of a variable depends on the runtime context.
F
T or F: hd is the predefined list function that returns the head of a list in Scheme.
F
____ languages require all tokens to occur in prespecified locations on the page.
Fixed-format
____ are generally bound at load time.
Global variables
Most logic programming systems restrict themselves to a particular subset of predicate calculus called ____.
Horn clauses
T or F: A grammar for which two distinct parse trees are possible for the same string is considered to be ambiguous.
T
T or F: A higher-order function returns a function as a value.
T
T or F: A language is considered to be fully curried if function definitions are treated as curried and if all multiparameter built-in functions are curried.
T
T or F: A language that adds new features via additional releases is considered to be extensible.
T
T or F: A left-recursive rule for an operation causes it to left-associate.
T
T or F: A logic programming language is a notational system for writing logical statements together with specified algorithms for implementing inference rules.
T
T or F: A programming language's words are referred to as tokens.
T
T or F: A structured control abstraction divides a program into groups of instructions.
T
T or F: A translator that produces an equivalent program in an executable form is called a compiler.
T
T or F: A translator's symbol table stores the mappings between names and attributes.
T
T or F: A virtual machine is an interpreter.
T
T or F: Abstract syntax trees abstract the essential structure of the parse tree.
T
T or F: Abstraction is the collection of similar operations from two different components into a new component.
T
T or F: All built-in classes in Smalltalk are subclasses of the Object class.
T
T or F: An abstraction is a way of expressing ideas that make them concise, simple, and easy for the human mind to grasp.
T
T or F: An example of a Horn clause is a1 and a2 and a3 → b.
T
T or F: Any scoping structure that can be referenced directly in a language must have its own symbol table.
T
T or F: Automated deduction systems have difficulty handling all of first-order predicate calculus.
T
T or F: Before the middle of the 1940s, computer operators hardwired their programs by setting switches that adjusted the internal wiring of the computer.
T
T or F: Binding time refers to when an attribute is computed and bound to a name.
T
T or F: C++ member functions that are given implementations in a class declaration are automatically assumed to be inline.
T
T or F: C++ permits an object to be allocated either directly on the stack or as a pointer.
T
T or F: C++ was designed to be a multiparadigm language that would not enforce any one style of programming.
T
T or F: Dangling references are locations that have been deallocated from the environment but can still be accessed by a program.
T
T or F: Declaration visibility includes only those regions of a program where the bindings of the declaration apply.
T
T or F: Declarations in surrounding blocks are called nonlocal declarations.
T
T or F: Derivation is the process that replaces left-hand sides by choices of right-hand sides appearing in prior rules.
T
T or F: Each function call generates a region of allocated memory associated with the function; this is called an activation record.
T
T or F: Early dialects of FORTRAN supported static storage allocation only.
T
T or F: Extending an object is one way that a software component can be modified for reuse.
T
T or F: Haskell supports a type class inheritance through a hierarchy of type classes.
T
T or F: Horn clauses can be viewed as specifications of procedures rather than strictly as implementations.
T
T or F: In C++, template classes can be used to define generic collections.
T
T or F: In C, blocks are called compound statements.
T
T or F: In ML, arithmetic operators are written as infix operators.
T
T or F: In Prolog, arithmetic terms can be written in either infix notation or prefix notation.
T
T or F: In Smalltalk, a message is a request for a service.
T
T or F: 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
T or F: In extended Backus-Naur form, square brackets [ ] indicate optional parts of the syntax.
T
T or F: Irregularities in a language may be the result of maintaining backward compatibility with a prior version of the language.
T
T or F: Java demonstrates a lack of orthogonality in its different handling of primitive data types and object data types.
T
T or F: Java is considered to be a semantically safe language.
T
T or F: Locations are places where values can be stored.
T
T or F: Logical statements can be either true or false.
T
T or F: Logical statements can be used as formal specifications for the required behavior of programs.
T
T or F: Machine code was considered to be the first software.
T
T or F: Macros can be used to improve the readability of a language.
T
T or F: Most Prolog systems are run as interpreters, not compilers.
T
T or F: Multiple inheritance in C++ ordinarily creates separate copies of each class on an inheritance path.
T
T or F: Names can be bound to attributes prior to translation time, as in the case of predefined identifiers.
T
T or F: Names can be reused within nested blocks by associating each declaration with a level number and an offset.
T
T or F: 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.
T
T or F: One of the design goals of C++ was that it would be highly portable.
T
T or F: Ordinary syntax is sometimes called concrete syntax to distinguish it from abstract syntax.
T
T or F: Prolog applies resolution in a strictly linear fashion, replacing goals from left to right.
T
T or F: Prolog is vulnerable to infinite loops because it uses a depth-first search.
T
T or F: Public members are those accessible to client code as well as to derived classes.
T
T or F: Python is type-checked at runtime.
T
T or F: Python was designed to bridge the gap between a systems language like C and a shell language like Perl.
T
T or F: 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.
T
T or F: Regular expressions can be used to describe tokens.
T
T or F: Scheme expressions must be written in prefix form.
T
T or F: Shift-reduce parsers shift tokens onto a stack before reducing strings to nonterminals.
T
T or F: Smalltalk and Java require the use of a garbage collector to return inaccessible storage to the heap.
T
T or F: Smalltalk provides a small set of binary messages that allow the programmer to write arithmetic and comparison expressions.
T
T or F: Specification languages would allow users to indicate their requirements and would then implement those requirements.
T
T or F: Statements that can be derived from the logic program are known as queries or goals.
T
T or F: The ALGOL programming language provides support for recursive procedures.
T
T or F: The FORTRAN language provided support for algebraic notation and floating-point numbers.
T
T or F: The ML programming language has a built-in list reverse function called rev.
T
T or F: The ML programming language is strongly typed.
T
T or F: The if form in Scheme is like an if-else construct.
T
T or F: The lambda calculus was based on the theory of recursive functions.
T
T or F: The lexical structure of a programming language is the structure of its tokens, or words.
T
T or F: The lifetime of an object is the duration of its allocation in the environment.
T
T or F: The primary design goal of early programming languages was efficiency of execution.
T
T or F: The primary feature of an imperative language is a sequence of statements that represent commands.
T
T or F: The process of unification can be used to shorten clauses.
T
T or F: The simplest unit of syntax in Scheme is called an atom.
T
T or F: The start symbol is used to identify the start of the grammar.
T
T or F: The statements a → b and b → c then a → c are an example of a typical inference rule.
T
T or F: The syntax of a programming language is like the grammar of a natural language.
T
T or F: The use of variable names is considered to be a basic data abstraction.
T
T or F: Theorems are derived from axioms.
T
T or F: 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
T or F: White space is an example of a token delimiter.
T
T or F: Words or tokens are called terminals, since they cannot be broken down further.
T
The history of object-oriented programming languages begins in the 1960s with the Simula project.
T
The process of associating the semantics of a construct to its syntactic structure is called syntax-directed semantics.
T
To determine if two lists have the same fringe, we must flatten them to just lists of their atoms.
T
T or F: Every logical statement can be turned into Horn clauses.
F
T or F: FORTRAN was the first programming language to be machine independent.
F
T or F: FORTRAN's designers attempted to improve the readability of programs by making the constructs look like ordinary written English.
F
T or F: Horn clauses cannot be given a procedural interpretation.
F
T or F: If an operator can be used to perform more than one operation, it is said to be shadowed.
F
T or F: In C++, declarations that bind all potential attributes are called prototypes.
F
T or F: In C++, instance variables and methods are both called descriptors.
F
T or F: In C++, objects can only be allocated on the heap.
F
T or F: In Java, scalar data types are objects for reasons of efficiency.
F
T or F: In Prolog, you can specify the head and tail of a list using a backslash.
F
T or F: In Scheme, a let special form can be used to define a recursive function.
F
T or F: In Scheme, the letrec form makes a global binding of a variable visible in the top-level environment.
F
T or F: In a regular expression, curly braces are used to indicate a range of characters.
F
T or F: In the ML programming language, a function is declared using the lambda keyword.
F
T or F: Java and Smalltalk both allocate objects directly onto the stack for efficiency.
F
T or F: Java requires manual deallocation of objects.
F
T or F: Java uses assignment by cloning for all object variables.
F
T or F: Lexical scoping rules are sometimes called dynamic scoping.
F
T or F: Lists that obey lazy evaluation are called serialized lists.
F
T or F: Logic programming uses second-order predicate calculus.
F
T or F: Machine language consists of entering a series of hexadecimal codes into the computer.
F
T or F: Messages in Smalltalk that expect arguments are called parameterized messages.
F
T or F: Most modern languages are in a completely fixed format.
F
T or F: Pascal uses a dedicated return statement for returning values from functions.
F
T or F: Predictive parsing allows tokens that begin optional parts of the syntax to also appear after the optional part.
F
T or F: Productions are in Backus-Naur form if they are given using only the metasymbols "<" and ">".
F
T or F: Prolog completely satisfies the original goal of logic programming.
F
T or F: Python uses statement terminators such as the semicolon.
F
T or F: Referencing is the ability of a class to use the behavior and/or properties of classes above it in its hierarchy.
F
T or F: Reserved words, or keywords, are not considered to be a typical token category.
F
T or F: Resolution is an especially inefficient inference rule for Horn clauses.
F
T or F The presence of explicit data types in variable declarations in a language allows for more concise code.
F
T or F: 4. The unique structure of each application is referred to as an application framework.
F
T or F: A function that takes other functions as parameters or returns a function as a value is called a recursive function.
F
T or F: A linker program is used to load machine code into computer memory.
F
T or F: A procedure is a function that returns a value to its caller.
F
T or F: A program written in Python will require many more lines of code than if it were written in C++.
F
T or F: A pure functional program is one that consists only of functions and procedures.
F
T or F: A recognizer is a program that accepts or rejects strings based on whether they have occurred before.
F
T or F: A translator that executes a program directly is called a compiler.
F
T or F: A variable introduced by a quantifier is said to be free and not bound by the quantifier
F
T or F: Abstract classes are often instantiated by the application program.
F
T or F: Assembly language consists of entering a series of binary codes into the computer.
F
T or F: Assembly language is standard across all types of computer hardware architectures.
F
T or F: C was chosen as the base language for C++ because it contained class constructs.
F
T or F: C++ does not have a formal language definition.
F
T or F: C++ has built-in garbage collection.
F
T or F: C++ is an open source language that has never had a commercial release.
F
T or F: C++ was not intended to undergo incremental development.
F
T or F: Design goals for programming languages have not changed through the years.
F
____ automatically translate a BNF description into a parser.
Syntax generators
Which of the following statements about a programming language is correct?
Syntax refers to the structure of the language, while semantics refers to the meaning of the language.
A conflict between syntax and semantics arises when languages require certain strings to be predefined identifiers rather than reserved words.
T
T or F: 1. Backus-Naur forms are used to describe the syntax of programming languages such as Algol60.
T
T or F: 16. Prolog is the most widely used logic programming language.
T
T or F: A Scheme compiler will translate a tail recursive function into code that executes as a loop.
T
T or F: A block consists of a sequence of declarations followed by a sequence of statements.
T
T or F: A bottom-up parser constructs derivations and parse trees from the leaves to the root.
T
T or F: A function application is a call to a defined function using actual parameters.
T
T or F: A function definition describes how a value is to be computed using formal parameters.
T
T or F: A fundamental abstraction mechanism in any programming language is the use of names, or identifiers to denote language entities or constructs.
T
Which of the following Scheme statements will insert the number 6 at the head of a list named L? a. (add 6 L) b. (insert 6 L) c. (hd 6 L) d. (cons 6 L)
d. (cons 6 L)
Which of the following statements about functional programming languages is incorrect? a. In pure functional programming, there are no assignments. b. In pure functional programming, there are no loops. c. In pure functional programming, loops are replaced by recursive calls. d. The value of a function depends on the order of evaluation of its parameters.
d. The value of a function depends on the order of evaluation of its parameters.
Variables are given names and data types using a ____.
declaration
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 ____.
deductive databases
In Java, the ____ constructor takes no parameters.
default
Prolog programs use a particular kind of grammar rules called ____.
definite clause grammars
In C++, declarations that bind all potential attributes are called ____.
definitions
C++ includes ____, which specify how to deallocate memory for objects.
destructors
A ____ rule must be stated to overcome ambiguous grammars.
disambiguating