Programming Concepts Final Exam

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

A function that takes other functions as parameters or returns a function as a value is called a recursive function.

False

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

False

In Prolog, you can specify the head and tail of a list using a backslash.

False

In Scheme, arithmetic operators are written as infix operators.

False

Java requires manual deallocation of objects.

False

Lists that obey lazy evaluation are called serialized lists.

False

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

False

Static constants are always computed at load time.

False

The fact that Pascal does not allow functions and procedures to be assigned to variables indicates a lack of _____ in the language.

Generality

A map is an example of a(n) _____.

Higher-Order Function

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 function is considered to be _____ if a compiler may replace the function call by the actual code for the function.

Inline

In Java, an object's _____ is the set of messages it recognizes.

Interface?

Grammar rules are also called _____.

Productions

A list is written in Prolog using _____ to enclose the items.

Square Brackets []

Which of the following is an object-oriented language?

C++

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

A pure functional program is one that consists only of functions and procedures.

False

Assembly language consists of entering a series of binary codes into the computer.

False

Assembly language is standard across all types of computer hardware architectures.

False

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

False

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

False

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

False

A(n) _____ is an object associated with a collection, and is used to visit each element in the collection.

Iterator

Which of the following is a functional language?

Lisp

In lambda calculus, a conversion that allows for the elimination of redundant lambda abstractions is called _____.

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

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

The first programming language to incorporate the object paradigm in a thorough and consistent way was _____.

Smalltalk-80

The ALGOL programming language provides support for recursive procedures.

True

The FORTRAN language provided support for algebraic notation and floating-point numbers.

True

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

True

The process of associating the semantics of a construct to its syntactic structure is called syntax-directed semantics.

True

The rand function is referentially transparent.

True

The start symbol is used to identify the start of the grammar.

True

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

True

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

True

The _____ quantifier represents all things in the universe named by the variable.

Universal

The semantics of programming language constructs is called _____.

Axiomatic Semantics

A variable in a programming language is considered to be a(n) _____.

Basic Data Abstraction

In Java, the _____ constructor takes no parameters.

Default

The irregularities of primitive types and reference types in Java is the result of the designer's concern with _____.

Efficiency

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

False

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

False

The kind of logic used in logic programming is lambda calculus.

False

A _____ constant is a name for a literal.

Manifest

The closed-world assumption is that all solutions _____ or are assumed false.

Must be proved true

Derivation is the process that replaces left-hand sides by choices of right-hand sides appearing in prior rules.

True

In C, blocks are called compound statements.

True

Locations are places where values can be stored.

True

Python is type-checked at runtime.

True

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))

Variables are given names and data types using a(n) _____.

Declaration

Logic programming systems are sometimes referred to as _____.

Deductive Databases

C++ includes _____, which specify how to deallocate memory for objects.

Destructors

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

Which of the following properties is least exhibited by Python?

Efficiency

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

False

The unique structure of each application is referred to as an application framework.

False

All built-in classes in Java are subclasses of the Object class.

False (SmallTalk)

C++ and Java require the use of a garbage collector to return inaccessible storage to the heap.

False?

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

A member function of a class that contains code in the class declaration is called a(n) _____.

Inline Function

Variables set equal to patterns are said to be _____.

Instantiated

_____ are phrase structures that are broken down into further phrase structures.

Nonterminals

In C++, arguments to a parameterized constructor are enclosed in _____ in the object's declaration.

Parenthesis ()

_____ automatically translate a BNF description into a parser.

Parser Generators

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 parser that commits itself to a particular action based only on a lookahead is called a(n) _____ parser.

Predictive

The simplest form of a parser is a(n) _____.

Recognizer

_____ languages allow the user to enter the requirements for a program and have the system implement the requirements.

Specification

The lexical structure of a programming language is similar to the _____ in a natural language.

Spelling

In Prolog, the cut operator is used to _____.

Stop a search of a tree

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

The scope of a binding is _____.

The region over which the binding is maintained

Which of the following statements about functional programming languages is incorrect?

The value of a function depends on the order of evaluation of its parameters

The lexical structure of a programming language is the structure of its _____.

Tokens

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

True

A higher-order function returns a function as a value.

True

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

True

Automated deduction systems have difficulty handling all of first-order predicate calculus.

True

Most Prolog systems are run as interpreters, not compilers.

True

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

True

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

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.

True

Prolog applies resolution in a strictly linear fashion, replacing goals from left to right.

True

Prolog is vulnerable to infinite loops becuase it uses a depth-first search.

True

White space is an example of a token delimiter.

True

In object-oriented programming, a message is a request for a service.

True?

_____ are any storable quantities, such as integers.

Values

A _____ is an object whose stored value can change during execution.

Variable

Which of the following is not considered to be a token category?

White Space

Which of the following represents a list of data in Scheme?

(quote (3.1 3.2 3.3))

Expression '(1 2 3) in Lisp can also be written as:

?

The Scheme programming language has a built-in list construction function called "list".

?

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

A(n) _____ gives a programmer information about a resource's classes, methods, and functions.

API


Ensembles d'études connexes

Ricci CH 48 (Pediatric diabetes)

View Set

OB - Chapter 11: Chapter 10 Ch 12, Ch. 17 & 18 Practice Questions

View Set

Drugs acting on the renin-angiotensin-aldosterone system

View Set

Physiology - Muscles, Body Movement, Blood & Cardiovascular

View Set

ECON131 Chapter 6: Measuring Inflation and Unemployment

View Set