Exam 1 (programming lang)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Which of the following scheme statements will insert the number 6 at the head of a list named L?

(cons 6 L)

Which of the following correctly assigns values to two variables and then multiplies them in the Scheme programming language?

(let ((x 5) (y 3)) (* x y))

given a list L in scheme with contents of ((xy) s(t)). What will be returned if the command (cdr (car L)) is executed?

(y)

Which of the following statements about scoping in Scheme is correct?

A free variable is a variable referenced within a function that is not also a formal parameter to that function.

____ 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. T/F

API

In a program, selection and iteration are accomplished by the use of ___

Branch instructions

Which of the following is an object-oriented language?

C++

Which of the following statements is correct?

Delayed execution can lead to well-defined results, even when subexpressions or parameters may be undefined

Which of the following statements about programming languages is correct?

Pascal is based on ALGOL

All of the following languages are statically typed except ____.

Python

Which of the following is most closely related to reliability?

Security

A class is considered to be a ___

Unit abstraction

The Scheme evaluation rule represents ____ evaluation.

applicative order

A variable in a programming language is considered to be a ___

basic data abstraction

in lambda calculus, a conversion that allows for the elimination of redundant lambda abstractions is call ___.

eta-conversion

A language that allows the user to add features to it is said to have the property of _____

extensibility

A language achieves ___ by avoiding special cases in the use of constructs.

generality

The real benefit of deferring type checking until runtime is ___

greater programmer efficiency

A map is an example of a(n) ____

higher-order function

C++ ___

is an object-oriented language

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

A ___ specifies the syntax of a piece of code that expands to other standard code.

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.

orthogonality

to express symbols as a data type in scheme, use the keyword ___.

quote

in lambda calculus, a value can be substituted for a variable by use of a(n)___.

reduction rule

Which of the following statements about scheme is correct?

scheme function applications use pass by value, while special forms in scheme use delayed evaluation

An iterator is an example of a ____.

structured control abstraction

The term ___ refers to a programming language mechanism that replaces a complex notation with a simpler notation

syntactic sugar

Because C++ requires a semicolon after a class definition but not after a function definition, C++ is said to lack ____.

uniformity

A module, a class, and a package are all examples of ____.

unit data abstractions

The essential construct of lambda calculus is called the lambda application. T/F

F

The first assembly languages appeared in the 1970s. T/F

F

The lexical structure of a programming language is similar to grammar in a natural language. T/F

F

The most important design criterion of the last 25 years has been the goal efficiency. T/F

F

The presence of explicit data types in variable declarations is in a language allows for more concise code. T/F

F

The semantics of scheme uses static type checking. T/F

F

The syntax of a programming language refers to its meaning. T/F

F

When applied to data types, value semantics means that assignment produces two references to the same object. T/F

F

When no type errors are caught during execution, we can infer that they do not exist. T/F

F

With static scoping, the meaning of a variable depends on the runtime context. T/F

F

a function that takes other functions as parameters or returns a function as a value is called a recursive function. T/F

F

hd is the predefined list function that returns the head of a list in scheme. T/F

F

in scheme, a let special form can be used to define a recursive function. T/F

F

in scheme, the letrec form makes a global binding of a variable visible in the top-level environment. T/F

F

the rand function is referentially transparent. T/F

F

The ALGOL programming language provides support for recursive procedures. T/F

T

The lambda calculus was based on the theory of recursive functions. T/F

T

The primary feature of an imperative language is a sequence of statements that represent commands. T/F

T

The simplest unit of syntax in Scheme is called an atom. T/F

T

The syntax of a programming language is like the grammar of a natural language. T/F

T

The use of variable names is considered to be a basic data abstraction. T/F

T

To determine if two lists have the same fringe, we must flatten them to just lists of their atoms. T/F

T

a scheme compiler will translate a tail recursive function into code that executes as a loop. T/F

T

Which of the following is an example of lack of generality in a language?

In C, arrays cannot be directly compared using the == operator

A linker program is used to load machine code into computer member. T/F

F

A program written in Python will require many more lines of code than if it were written in C++. T/F

F

A translator that executes a program directly is called a compiler. T/F

F

C was chosen as the base language for C++ because it contained class constructs. T/F

F

C++ is an open source language that has never had a commercial release. T/F

F

Design goals for programming languages have not changed through the years.

F

FORTRAN was the first programming language to be machine independent. T/F

F

FORTRAN's designers attempted to improve the readability of programs by making the constructs look like ordinary written english. T/F

F

Pascal uses a dedicated return statement for returning values from functions. T/F

F

Scheme expressions that begin with keywords are called control forms. T/F

F

A text file is considered to be a ___

Structured data abstraction

An array is considered to be a ___

Structured data abstraction

A function application is a call to a defined function using actual parameters. T/F

T

A function definition describes how a value is to be computed using formal parameters. T/F

T

A higher-order function returns a function as a value. T/F

T

A language that adds new features via additional releases is considered to be extensible. T/F

T

A programming language's words are referred to as tokens.

T

A programming language's words are referred to as tokens. T/F

T

A structured control abstraction divides a program into groups of instructions. T/F

T

A virtual machine is an interpreter. T/F

T

Early dialects of FORTRAN supported static storage allocation only. T/F

T

Java demonstrates a lack of orthogonality in its different handling of primitive data types and object data types. T/F

T

Macros can be used to improve the readability of a language. T/F

T

Python was designed to bridge the gap between a systems language like C and a shell language like perl. T/F

T

Specification languages would allow users to indicate their requirements and would then implement those requirements. T/F

T


Kaugnay na mga set ng pag-aaral

FINC exam 3 learnsmart questions

View Set

ECON Chapter 10: Monopolistic Competition & Oligopoly

View Set

AP Chem Unit 3.5: Kinetic Molecular Theory

View Set

Human Development Test 1 Study Guide

View Set

Fundamentals : Carin and Vital Signs Quiz

View Set