CS4303 - Exam 1, CS4303 - Exam 2, 4102 Chapter 6, 4102 Chapter 7
'hd' is the predifined list function that returns the head of a list in Scheme. (T/F)
False
A function that takes other functions as parameters or returns a function as a value is called a recursive function. (T/F)
False
A linker program is used to load machine code into computer memory (T/F)
False
A procedure is a function that returns a value to its caller. (T/F)
False
A program written in Python will require many more lines of code than if it were written in C++. (T/F)
False
A pure functional program is one that consists only of functions and procedures. (T/F)
False
Assembly language consists of entering a series of binary codes into the computer. (T/F)
False
Assembly language is standard across all types of computer hardware architectures. (T/F)
False
C++ does not have a formal language definition. (T/F)
False
C++ is an open source language that has never had a commercial release. (T/F)
False
Design goals for programming languages have not changed through the years. (T/F)
False
FORTRAN was the first programming language to be machine independent.
False
In Scheme, a 'let' special form can be used to define a recursive function. (T/F)
False
In Scheme, the 'letrec' form makes a global binding of a variable visibile in the top level environment. (T/F)
False
Machine language consists of entering a series of hexadecimal codes into a computer. (T/F)
False
Pascal uses a dedicated return statement for returning values from functions. (T/F)
False
Python uses statement terminators such as the semicolon. (T/F)
False
Scheme expressions that begin with keywords are called control forms. (T/F)
False
The 'rand' function is referentially transparent. (T/F)
False
The ease with which a complex process or structure can be expressed in a programming language is called its regularity. (T/F)
False
The first assembly languages asppeared in the 1970s. (T/F)
False
The presence of explicit data types in variable declarations in a foreign language allows for more concise code. (T/F)
False
The presence of explicit data types in variable declarations in a language allows for more concise code. (T/F)
False
The syntax of a programming language refers to its meaning (T/F)
False
When applied to data types, value semantics means that assignment produces two references to the same object. (T/F)
False
When no type errors are caught during execution, we can infer that they do not exist. (T/F)
False
With static scoping, the meaning of a variable depends on the runtime context. (T/F)
False
The definition of a language using an interpreter written in the same language is called a _____ .
Metacircular interpreter
A Scheme compiler will translate a tail recursive function into code that executes as a loop. (T/F)
True
A function application is a call to a defined function using actual parameters. (T/F)
True
A function definition describes how a value is to be computed using formal parameters. (T/F)
True
A language that adds new features to additional releases is considered to be extensible. (T/F)
True
A programming language's words are referred to as tokens. (T/F)
True
A translator that produces an equivalent program in an executable form is called a compiler. (T/F)
True
An abstraction is a way of expressing ideas that make the concise, simple, and easy for the human mind to grasp. (T/F)
True
Before the middle of the 1940s, computer operators hardwire their programs by setting switches that adjusted the internal wiring of the computer. (T/F)
True
Irregularities in a language may be the result of maintaining backward compatibility with a prior version of the language. (T/F)
True
Java is considered to be a semantically safe language. (T/F)
True
Machine code was considered to be the first software. (T/F)
True
Macros can be used to improve the readability of a language. (T/F)
True
Python was designed to bridge the gap between a systems language like C and a shell language like Perl. (T/F)
True
Scheme expressions must be written in prefix form. (T/F)
True
Specification languages would allow users to indicate their requirements and would then implement those requirements (T/F)
True
The 'if' form in Scheme is like an if-else construct. (T/F)
True
The ALGOL programming language provides support for recursive procedures. (T/F)
True
The FORTRAN language provided support for algebraic notation and floating-point numbers. (T/F)
True
The lambda calculus was based on the theory of recursive functions (T/F)
True
The primary design goal of early programming languages was efficiency of execution. (T/F)
True
The primary feature of an imperative language is a sequence of statements that represent commands. (T/F)
True
To determine if two lists have the same fringe, we must flatten them to just lists of their atoms. (T/F)
True
Which of the following correctly assigns values to two variables and then multiplies them in the Scheme programming language? a. (let ((x 5) (y 3)) (* x y)) b. (let (x 5) (y 3)) (* x y) c. let (x 5) (y 3) (* x y) d. (let (x 5 y 3) (* x y))
a. (let ((x 5)(y 3)) (* x y))
Given a list L in Scheme with contents of ((x y) s (t)). What will be returned if the command (cdr (car L)) is executed? Select one: a.(y) b.(x) c.(x y) d.(t)
a. (y)
The Scheme evaluation rule represents ____ evaluation. Select one: a. applicative order b. sequential order c. binary order d. normal order
a. Applicative order
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
a. Iterator
In lambda calculus, a value can be substituted for a variable by use of a(n) ____. a) reduction rule b) evaluation rule c) abstraction rule d) application rule
a. Reduction rule
Which of the following statements about Scheme is correct? a. Scheme is not fully curried and it supports delayed evaluations. b. Scheme is a fully curried language that does not do delayed evaluation. c. Scheme is a fully curried and lazy language. d. Scheme does not support higher-order functions.
a. Scheme is not fully curried and it supports delayed evaluations.
____ abstractions support information hiding. Select one: a. Unit data b. Structured control c. Basic data d. Structured data
a. Unit data
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
a. basic data abstraction
Variables are given names and data types using a ____. Select one: a. declaration b. function c. package d. structure
a. declaration
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.
a. generality
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
a. levels
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
a. macro
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
a. orthogonality
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
a. structured control 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
a. syntactic sugar
____ was the first programming language to have a formal definition. Select one: a. ADA b. ALGOL c. Assembly language d. FORTRAN
b. ALGOL
The ____ programming paradigm has achieved widespread use over the last 20 years. Select one: a. logic b. object-oriented c. functional d. assembler
b. Object-oriented
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
b. 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
b. Unit data
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
b. compiler
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
b. greater programmer efficiency
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
b. scientists and engineers and other non-programmers
Which of the following is most closely related to reliability? Select one: a. Uniformity b. Security c. Generality d. Regularity
b. security
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
b. strong data typing
Which of the following statements about scoping in Scheme is correct? a. A bound variable is a variable referenced within a function that is also a formal parameter to the 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 bounded 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.
A ____ gives a programmer information about a resource's classes, methods, and functions. Select one: a. package b. library c. API d. component
c. API
Which of the following statements is correct? Select one: 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 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.
c. Operations on lists must evaluate the entire list.
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
c. Spelling
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.
c. Syntax refers to the structure of the language, while semantics refers to the meaning of the language.
Of the following languages, which is a statically typed language? Select one: a. Lisp b. Python c. Ada d. Smalltalk
c. ada
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
c. branch instructions
Lisp is based on the ____ model of computation. Select one: a. semantic b. interpretive c. functional d. imperative
c. functional
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
c. 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
c. it is based on a small but powerful set of primitive operations and data types that can be easily extended
An array is considered to be a ____. Select one: a. basic data abstraction b. basic control abstraction c. structured data abstraction d. unit abstraction
c. structured data abstraction.
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
c. uniformity
Given a list L in Scheme with contents of (3 7 2 8). What will be returned if the command (cdr L) is executed? Select one: a.(8) b.(3) c.(2 8) d.(7 2 8)
d. (7 2 8)
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)
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
d. Extensibility
All of the following languages are statically typed except ____. Select one: a. Ada b. C++ c. C d. Python
d. Python
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
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
d. efficiency
Which of the following properties is least exhibited by Python? Select one: a. simplicity b. portability c. extensibility d. efficiency
d. efficiency
A language achieves ____ by avoiding special cases in the use of constructs. Select one: a. orthogonality b. efficiency c. uniformity d. generality
d. generality
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
d. refers to how easy it is to express complex processes
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
d. syntactic sugar
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
d. writability
The _____ is used in Scheme to create a function.
lambda special form