xd

¡Supera tus tareas y exámenes ahora con Quizwiz!

What design criterion was used extensively in ALGOL 68? Readability Orthogonality Reliability Simplicity

Orthogonality

Which of the following languages have dynamic type binding? PHP C Fortran JavaScript

PHP JavaScript

Which of the following languages have implicit declarations? C++ PL/I BASIC Fortran

PL/I BASIC Fortran

What Ada construct provides support for abstract data types? Arrays Packages Tasks Records

Packages

The Delphi language was derived from what language? Ada C++ C Pascal

Pascal

Which of the following does not belong to an attribute grammar? Predicate functions Semantic functions Attributes Inference rules

D

Aliases can be created by which of the following parameter passing methods? Pass-by-value Pass- by-result Pass-by-reference Pass-by-name

Pass-by-reference

What organization was most responsible for the early success of COBOL (in terms of extent of use)? Pentagon ACM GUIDE IBM

Pentagon

Which of the following languages have implicit type declarations? Java Perl Fortran C

Perl Fortran

Which of the following languages does not provide built-in-pattern matching operations (the language, although, has pattern matching capabilities included in its class libraries)? Perl PHP JavaScript Java

Java

Which of the following languages does not support user-defined operator overloading? Java C++ F# C#

Java

Which of the following languages allow only Boolean (not arithmetic) expressions for loop control in the for statement? Java C C# C++

Java c#

Which languages support the operator "==="? C++ PHP Javascript C#

JavaScript PHP

Which of the following languages use dynamic type binding? Perl JavaScript PHP C++

JavaScript PHP

Which of the following languages do not require parameter type checking? JavaScript C# PHP Perl

JavaScript PHP Perl

Which of the following languages allow nested subprograms? C Correct JavaScript Correct Ada C++

JavaScript Ada

Scheme is a dialect of which of the following languages? LISP Prolog Perl PL/I Perl

LISP

What programming language has dominated artificial intelligence over the past 40 years? FLOWMATIC COBOL Fortran LISP

LISP

Left recursion specifies:

Left operator Associativity

Left recursion specifies: Left operator precedence Right operator precedence Left operator associativity Right operator associativity

Left operator associativity

Which of the following C++ features are not included in Java? Pointers Stand-alone subprograms Multiple inheritance None of the above

Pointers Stand-alone subprograms Multiple inheritance

Which of the following features are in C# but not in Java? struct type break statement Pointers for statement all of the above

Pointers struct type

What characteristic of Java is most evident in JavaScript? Object orientation Syntax Strong typing Semantics

Syntax

Which of the following errors can be detected by a lexical analyzer? Omission of closing parenthesis in an expression Syntax errors in tokens Two consecutive IF in a statement, such as: IF IF (a >0) a++ ; Omission of the plus sign in an expression

Syntax Errors in Tokens

Which programming domain best describes C? Scientific Apps, Systems Programming, Business Apps, AI

Systems Programming

What are the concurrent program units of Ada called? Packages Procedures Functions Tasks

Tasks

Which parameter passing method would be preferred (in terms of storage) when a large array is to be passed to a subprogram that does not modify it?

pass-by-reference

Consider the following decalaration in C: int arr[20]; What kind of variable is arr if it is defined inside a function?

stack-dynamic

What construct of a programming language provides process abstraction? subprograms pointers arrays classes

subprograms

Which of the following sentences cannot be derived using the grammar of Example 3.2? A = A + (B + C) A = C * (A * C + B) A = A * (B + (C * A)) A = A * (B + ( C ))

A = A + (B + C)

What is a token?

A category of lexemes

What is a token? A character A group of characters A lexeme A category of lexemes A symbol, such as name, identifier, or literal

A category of lexemes

Consider the following program: function main() { var a, b; function sub1(x) { var b, c; b = 2; c = 3; a = b + c; } a = 1; b = 1; sub1(b); } What is the reference to b in the expression a = b + c (in terms of chain-offset/local offset)? (0,3) (1,4) (1,3) (0,4)

(0,4)

Which of the following are terminal symbols in the grammar rule: <expr> --> <expr> ( + | - | / | * ) <term> | <term> + ( | <expr>

+

Which of the following are terminal symbols in the grammar rule:<expr> --> <expr> ( + | - | / | * ) <term> | <term> ( + | <expr>

+

Which of the following operators are usually right associative in C-based languages? Binary + ++ -- Binary *

++ --

Suppose a=3, b=2, c=1. What is the result of the following expression in C89? 0 1 true false

0

In what year was Plankalkul designed? 1934 1949 1945 1972

1945

In what year was the Fortran design project begun? 1957 19521954 1949

1954

In what year did the COBOL design process begin? 1972 1960 1959 1962

1960

For what new line of computers was PL/I designed? 360 709X 1401 Minicomputers

360

Procedure A has static depth 3 and defines a variable which is visible in a nested subprocedure B. The nesting depth between procedure A and procedure B is 1 (that is, B is directly nested inside A). What is the static depth of B? 3 1 4 2

4

Which of the following are nonterminal symbols in the grammar rule: <factor> -> (++ | --) ident | (+ | -) (ident | int_literal) | (<expr>) + <expr> <factor> ident

<expr> <factor>

Which of the following are nonterminal symbols in the grammar: <if_stmt> --> if <expr> <statement> | if (<expr>) <statement> else <statement> if ( else <if_stmt>

<if_smtp>

Which of the following are nonterminal symbols in the grammar:<if_stmt> --> if <expr> <statement> | if (<expr>) <statement> else <statement> if ( else <if_stmt>

<if_stmt>

A simple phrase is A phrase that includes no more than two symbols A phrase that includes no nonterminal symbols A phrase that is generated in one derivation step A phrase that includes no terminal symbols

A phrase that is generated in one derivation step

A grammar is ambiguous if it:

A sentential form can produce two or more parse trees

A grammar is ambiguous if it: Has two or more rules with the same nonterminal on their LHS's Has two or more rules with the same RHS A sentential form can produce two or more parse trees Different sentential forms produce the same parse tree

A sentential form can produce two or more parse trees

What is the minimal collection of control statements that is enough to code an algorithm that can be expressed by a flowchart?

A two-way selection and a logically-controlled iteration

Which of the following are the two professional organizations together designed ALGOL 60? ACM GAMM GUIDE SHARE

ACM GAMM

What language used orthogonality as a primary design criterion? ALGOL 60 ALGOL 68 Fortran C

ALGOL 68

What language introduced the case statement? ALGOL-W ALGOL 60 Pascal ALGOL68

ALGOL-W

In which of the following languages do all operators have the same level of precedence? Java Ada APL JavaScript

APL

Which of the following languages use dynamic scoping? APL C# C++ Perl

APL Perl

Which of the following languages support dynamic scoping? C APL SNOBOL4 Fortran 95

APL SNOBOL4

Which of the following are disadvantages to local stack-dynamic variables in subprograms? Access to stack-dynamic variables is indirect The cost of allocation, initialization, and deallocation Subprograms cannot be history-sensitive Subprograms can be recursive

Access to stack-dynamic variables is indirect The cost of allocation, initialization, and deallocation Subprograms cannot be history-sensitive

For the deep access method, which of the following are true? Accesses to nonlocal variables is slower than with the shallow access method Subprogram linkage is slower than with the shallow access method Accesses to nonlocal variables is faster than with the shallow access method Subprogram linkage is faster than with the shallow access method

Accesses to nonlocal variables is slower than with the shallow access method Subprogram linkage is faster than with the shallow access method

Which of the following statements are true? Activation record instance is a concrete example of an activation record Activation record is a noncode part of a program A recursive program may have several activation record instances on the stack

Activation record instance is a concrete example of an activation record Activation record is a noncode part of a program A recursive program may have several activation record instances on the stack

Which of the following languages are nearly strongly typed? Fortran 95 Ada Ada C#

Ada C#

Which of the following languages allow nested subprograms? Ada C Fortran 95 JavaScript

Ada Fortran 95 JavaScript

Left recursion in a grammar is a problem for Only recursive descent parsers All top-down parsers All bottom-up parsers All parsers

All top-down parsers

What is exception handling? Dealing with the syntactic irregularities of a programming language Dealing with different ranges of parameter values in a subprogram Allowing a program to intercept run-time errors, take corrective measures, and then continue execution Dealing with syntax errors during complilation

Allowing a program to intercept run-time errors, take corrective measures, and then continue execution

Which of the following features were added to FORTRAN IV to get FORTRAN 77? An else clause Character string handling Recursive subprograms Records

An else clause Character string handling

Which of the following are primary design issues for names? Can names end in digits? Are names case sensitive? Can names begin with uppercase letters? Are the special words reserved words or keywords?

Are names case sensitive? Are the special words reserved words or keywords?

Which of the following is not a problem with dynamic scoping? Readability Array element access is slower Reliability Static type checking is not possible

Array element access is slower

What is one example of a lack of orthogonality in the design of C? Reserved words are written in lowercase letters There are no input or output operators Arrays cannot be returned by functions Identifiers are case sensitive

Arrays cannot be returned by functions

After language design and implementation, which of the following is not a time when bindings can take place? At run time At compile time At link time At the end of program execution

At the end of program execution

After language design and implementation, which of the following is not a time when bindings can take place? At link time At compile time At run time At the end of the execution of a subprogram

At the end of the execution of a subprogram

What do th Ada and COBOL languages have in common? Both were forced on users by DoD Both are for business applications Both are for scientific applications Both took a long time to develop

Both were forced on users by DoD

In what language is the majority of the UNIX operation system written? assembly language C Fortran B

C

In which language strings are terminated with a special character, null? F# C# Python C

C

In which languages can nested if statements be interpreted ambiguously? C C++ Perl Java

C C++ Java

Which of the following languages require explicit declarations of their variables? C Perl Correct Java JavaScript

C Java

Which language supports both rectangular and jagged arrays?

C#

Which of the following langages has readonly named constants? Ada Java C C#

C#

Which of the following languages have case-sensitive names? COBOL Fortran C# C++

C# C++

What programming language has dominated business applications over the past 40 years? Fortran C COBOL APL

COBOL

What does the break statement do in C and C++?

Causes the innermost loop (or switch) to be exited

In a static scoped language that uses static chaining as an implementation technique, references to non-local variables can be represented as: Static chain length/Local offset Static depth/Local offset Chain offset/Local offset Chain offset/Static depth

Chain offset/Local offset

Which of the following is not a characteristic of the overall cost of a programming language? Cost of training programmers Cost of compilers Cost of the host computer Cost of executing programs

Cost of the host computer

Which loops specify the initial and terminal values of the loop variable?

Counter-controlled loops

Which of the following are features of SIMULA 67 that are now important parts of object-oriented languages? Coroutines Multidimensional arrays Classes Inheritance

Classes Inheritance

Which of the following are not advantages in implementing a language with a pure interpreter? Code execution time is very fast The implementation is relatively simple Storing the whole source program requires significant storage for large programs Source-level debugging operations are easily implemented

Code execution time is very fast

What does a linker do? Collects system programs and links them to user programs Connects elements of a linked list Links gotos to their targets Connects actual parameters to formal parameters

Collects system programs and links them to user programs

Which of the following are skipped by the lexical analyzer? User-defined names Comments Blanks Reserved words

Comments, Blanks

Which approach to language implementation produces the fastest program execution? Hybrid system Pure interpreter Hand translation Compiler

Compiler

Which popular approach to language implementation produces the fastest program execution? Hand translation Pure interpreter Hybrid system Compiler

Compiler

What has been the strongest influence on programming language design over the past 45 years? Computer architecture DoD The growth of complexity of programs Evolving program design methodologies

Computer architecture

BNF is identical to: Unrestricted grammars Context-sensitive grammars Context-free grammars Regular grammars

Context-free grammars

Which of the following is true for coroutines? Coroutines have multiple entry points When restarted, a coroutine resumes its execution from the beginning Coroutines must be history sensitive Only one coroutine executes at a given time

Coroutines have multiple entry points Coroutines must be history sensitive Only one coroutine executes at a given time

Which of the following is not a characteristic of the overall cost of a programming language? Cost of compilers Cost of maintainability Cost of training programmers Cost of the host computer Cost of writing programs in the language

Cost of the host computer

Which of the following semantic description systems is most mathematical? Static semantics Operational semantics Denotational semantics Axiomatic semantics

Denotational semantics

Which of the following are considered advantages that functional languages have over imperativ languages? They are more execution efficient. Designing concurrent programs in functional languages is much easier. The syntax of functional languages is much simpler than that of the imperative languages. The semantics of functional languages are easier to describe formally than the semantics of the imperative languages.

Designing concurrent programs in functional languages is much easier. The syntax of functional languages is much simpler than that of the imperative languages. The semantics of functional languages are easier to describe formally than the semantics of the imperative languages.

The purpose of the pairwise disjointness test is to Determine whether a grammar is bottom-up parsable Determine whether a grammar is ambiguous Determine whether a grammar is top-down parsable Determine whether a grammar is parsable by any method

Determine whether a grammar is top-down parsable

What is the primary disadvantage of having too many features in a language? Different users learn different subsets, making programs more difficult to read and maintain The compiler is too large and too difficult to develop Language manuals are too long Too hard to learn

Different users learn different subsets, making programs more difficult to read and maintain

What is the primary application area for which Ada was designed? Embedded systems Scientific Accounting Artificial intelligence

Embedded systems

Which of the following is not a factor in readability? Control statements Orthogonality Special words Exception handling Multiplicity

Exception Handling

Which of the following is not a category of scalar variables defined by their lifetimes? Explicit stack dynamic Stack dynamic Static Explicit heap dynamic

Explicit stack dynamic

On what language was COBOL based? ALGOL 58 LISP FLOW-MATIC ROTRTAN

FLOW-MATIC

PL/I was designed to replace what two languages? FORTRAN BASIC FLOW-MATIC COBOL

FORTRAN COBOL

Which version of FORTRAN was the first to have any sort of dynamic variables? FORTRAN 90 FORTRAN II FORTRAN 66 FORTRAN 95

FORTRAN 90

Which of the following was the primary reason the relative slowness of interpretation of pseudocode programs was acceptable in the early 1950s? Floating-point arithmetic operations were done in software The machines were slow Memories were too small It was not then known how to write efficient interpreters

Floating-point arithmetic operations were done in software

What hardware capability that first appeared in the IBM 704 computer strongly affected the evolution of programming languages? Floating-point hardware Disk devices Solid state memory Index registers

Floating-point hardware

What programming language has dominated scientific computing over the past 40 years? COBOL C Fortran Basic

Fortran

Which of the following languages does not allow dynamic binding of values to named constants? C++ Ada Fortran 95 Java

Fortran 95

Which of the following is not a kind of attribute in an attribute grammar? Free Intrinsic Inherited Synthesized

Free

Which of the following statements about unions is false? Unions are potentially unsafe constructs in some languages Free unions use type indicators called tags Free unions do not allow type checking Unions are not included in C#

Free unions use types indicators

What kind of language is LISP? Imperative Logic-based Functional Scientific

Functional

Which languages use recursion rather than iteration to control repetition? Imperative C-based Scripting Functional

Functional

Which of the following data structures were not included in Plankalkul? Stacks Records Hashes Arrays

Hashes

Which of the following prevent a grammar from being top-down parsable? Having right recursive rules Having two RHSs of the same nonterminal that begin with the same string Having left recursive rules Having ε rules

Having right recursive rules Having two RHSs of the same nonterminal that begin with the same string

What is aliasing?

Having two or more distinct referencing methods, or names, for the same memory cell

What is aliasing? Having two or more distinct referencing methods, or names, for the same memory cell Rounding a floating-point value to an integer value Having variables in different subprograms with the same name Having a subprogram that can be called by two different names

Having two or more distinct referencing methods, or names, for the same memory cell

Which of the following array types can grow and shrink during program execution (please, remember that although subscript ranges of some array types are dynamically bound, they remain fixed during the lifetime of the array)? Static arrays Fixed stack-dynamic arrays Heap-dynamic arrays Fixed heap-dynamic arrays

Heap-dynamic arrays

What prevented Ada from becoming popular in its early days?

High cost of compilers

Which of the following need not be true for a loop invariant? I => Q {I and (not B)} => Q P => I {I and B} S {I}

I => Q

What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture? Functional Imperative Scientific Systems

Imperative

What category of programming languages best fits the von Neumann computer architecture? Systems Logic-based Imperative Functional Object-oriented

Imperitiv

Which of the following is true? In static scoping, the scope of a variable can be determined prior to execution In static scoping, some variable declarations could be hidden from some other code segments. In static scoping, program designers could use more globals than necessary. Static scoping is based on the calling sequence of subprograms

In static scoping, the scope of a variable can be determined prior to execution In static scoping, some variable declarations could be hidden from some other code segments. In static scoping, program designers could use more globals than necessary.

Which of the following is not a good reason to study programming languages? Increased ability to discuss programming languages Increased capacity to express ideas Better understanding of the significance of implementation Increased ability to learn new languages

Increased ability to discuss programming languages

Which of the following does not belong to an attribute grammar? Predicate functions Semantic functions Attributes Inference rules

Inference Rules

What missing language element of ALGOL 60 damaged its chances for widespread use? Multidimensional arrays Input/output statements Double-precision data type Functions

Input/output statements

Which of the following language deficiencies was one of the main factors behind the advent of new software development methodologies in 1970s? Incompleteness of data types Insufficient control statements Subprograms were too restrictive Lack of orthogonality

Insufficient control statements

What two programming language deficiencies were discovered as a result of the research in software development in the 1970s? Insufficient control statements and incompleteness of type checking Too many reserved words Too many data types Subprograms were too restrictive

Insufficient control statements and incompleteness of type checking

The C# switch statement differs from that of C in that:

It disallows the implicit execution of more than one segment

Why is the von Neumann bottleneck important? It controls the speed of data transfer among registers It limits the speed of a computer It controls the speed at which subprogram linkage can be completed It restricts the flow of data between the CPU and external storage devices

It limits the speed of a computer

What does it mean for a program to be reliable? It always terminates It compiles correctly It does not modify itself during execution It performs to its specification under all conditions

It performs to its specification under all conditions

The reference count method is an eager approach because of the following reason: It waits until the system runs out of dynamic memory It reclaims space when inaccessible cells are created It uses reference counters It is activated by the run-time system

It reclaims space when inaccessible cells are created

The handle of any rightmost sentential form is:

Its leftmost simple phrase

The generic methods of which language support wildcards? F# Java C++ C#

Java

Which language does not provide tuple as a built-in type? Python ML Java F#

Java

What kind of derivation is produced by top-down parsers?

Leftmost

What kind of derivation is produced by top-down parsers? Leftmost Rightmost Reverse of a rightmost Neither leftmost nor rightmost

Leftmost

What user group was the target of the first version of BASIC? Engineering students Liberal arts students Scientists Accountants

Liberal arts students

Which of the following data items are usually stored in an activation record? Local variables Nonlocal variables Return address Return value for a function (when the activation record corresponds to a function)

Local variables Return address Return value for a function (when the activation record corresponds to a function)

Which of the following languages allows functions/methods to be returned from functions/methods: C++ C# Ada Lua

Lua

Which of the following is not a part of axiomatic semantics? Assertions Mapping functions Weakest preconditions Inference rules

Mapping functions

What does the following code illustrate? float* ptr1 = new float; float* ptr2 = new float; ptr2 = ptr1;

Memory Leakage

Why was BASIC an important language in the early 1980s? It was the best all-around language of the time Poets could then use computers Microcomputers had small memories and BASIC interpreters could be very small BASIC was good for computer music

Microcomputers had small memories and BASIC interpreters could be very small

Which of the following are advantages to pass-by-reference? Access to formal parameters requires indirect addressing Aliases can be created No additional storage is required for storing formal parameters There is no need to copy actual parameters to the storage area of corresponding formal parameters

No additional storage is required for storing formal parameters There is no need to copy actual parameters to the storage area of corresponding formal parameters

Speedcoding was invented to overcome two significant shortcomings of the computer hardware of the early 1950s. Which of the following are these two? No floating-point hardware No floppy disks No cache memory No index registers

No floating-point hardware No index registers

Context-free grammars were devised by John Backus John McCarthy Noam Chomsky Peter Naur

Noam Chomsky

Which of the following can be sentenial forms? Non-terminal symbols Terminal symbols Sentences Rules

Non-terminal symbols Terminal symbols Sentences

The start symbol in a grammar is:

Nonterminal symbol

The start symbol in a grammar is: Terminal symbol Nonterminal symbol Neither terminal nor nonterminal Both terminal and nonterminal

Nonterminal symbol

To be useful, a parsing algorithm must have complexity no greater than O(n) O(n^3) NP complete O(n^2)

O(n)

The complexity of general parsing algorithms for any unambiguous grammar is:

O(n^3)

What populates the Smalltalk world? Classes Objects Small programs Selection statements

Objects

What is a nonprocedural language? One without subprograms One without multidimensional arrays One without functions One in which algorithms need not be spelled out in detail

One in which algorithms need not be spelled out in detail

Aliases can be created by which of the following language constructs? Pointers and reference variables The union types of C and C++ Arithmetic expressions IF statements

Pointers and reference variables The union types of C and C++

Which loops are guaranteed to be executed at least once?

Posttest logically controlled loops

A grammar is ambiguous if it: Produces a sentential form that has two distinct parse trees Has ε rules Has a rule with more than four RHSs Has two rules that have the same RHSs

Produces a sentential form that has two distinct parse trees

How can user-defined operator overloading harm the readability of a program? Programmers can define silly meanings to such operators, such as using * for addition of matrices Function calls are easier to understand than operators Program readers will not easily be able to determine the meanings of such operators Programmers require operators to retain their original meanings

Programmers can define silly meanings to such operators, such as using * for addition of matrices

By which of the following approaches were the pseudocodes off the early 1950s implemented? Hybrid systems Hardware simulation Compilers Pure interpreters

Pure interpreters

Parsers are based on which of the following mathematical machines? Deterministic finite automata Pushdown automata Turing machines Nondeterministic finite automata

Pushdown automata

Which language uses indentation to specify compound statements? Lua Scheme Ruby Python

Python

The existence of too many ways to accomplish a particular operation in a programming language can affect: Restricted aliasing Readability Type checking Exception handling

Readability

Which of the following is not a reason to separate lexical analysis from syntax analysis? Portability Simplicity Efficiency Readability

Readability

What is an example of two language design criteria that are in direct conflict with each other? Readability and writability Reliability and readability Readability and reliability Orthogonality and cost

Readability and writability

What array structure is included in C#, but not in C, C++, or Java? Stacks Records Rectangular arrays Queues

Rectangular arrays

When the system uses static chain to access nonlocal variables, which of the following are true? References to variables in scopes beyond the static parent cost more than references to locals References to variables in scopes beyond the static parent cost less than references to locals Both local and nonlocal variables are stored in the same activation record instance Nonlocal variables are stored in activation record instances of static ancestors

References to variables in scopes beyond the static parent cost more than references to locals Nonlocal variables are stored in activation record instances of static ancestors

Which of the following language evaluation criteria is/are violated by having case-sensitive names? Reliability Writability Cost Readability

Reliability Writability

What kind of derivation is produced by bottom-up parsers?

Reverse of Rightmost

What kind of derivation is produced by bottom-up parsers? Rightmost Neither leftmost nor rightmos Leftmost Reverse of a rightmost

Reverse of a rightmost

In which language all arithmetic, relational and assignment operators are implemented as methods? C++ Ada Ruby C#

Ruby

Which of the following languages does NOT have a goto statement? C Ruby C# Python

Ruby Python

What are the two kinds of statements that populate a Prolog database? Loops Rules Conditionals Facts

Rules Facts

What was the primary application area of computers at the time Fortran was designed? Scientific Artificial intelligence Business Computer gaming software

Scientific

What role does the symbol table play in a compiler? Records the number of syntax errors Serves as the database of information about the program Stores the reserved words Allows high-quality error messages

Serves as the database of information about the program

Elliptical reference is one in which: All record names are specified, starting from the largest enclosing record and finishing with the specific record field Records are referenced using level numbers Some enclosing record names are omitted Records are referenced using pointers

Some enclosing record names are omitted

Which of the following is not a category of scalar variables defined by their lifetimes? Stack dynamic Static Explicit stack dynamic Explicit heap dynamic

Static Explicit

Why are reserved words not recognized through state transitions in a lexical analyzer? Their structure is nearly the same as that of identifiers That would require a very large state diagram The number of reserved words may change as the language evolves Reserved words are inherently difficult to recognize using that approach

That would require a very large state diagram

Which of the following statements are true for a LL algorithm? The algorithm scans the input from left to right The algorithm produces a leftmost derivation The algorithm is top-down The algorithm can handle left recursion

The algorithm scans the input from left to right The algorithm produces a leftmost derivation The algorithm is top-down

A dynamic link points to: The bottom of the activation record instance of the static parent The top of the activation record instance of the static parent The top of the activation record instance of the dynamic parent The bottom of the activation record instance of the dynamic parent

The bottom of the activation record instance of the dynamic parent

A static link points to: The bottom of the activation record instance of the static parent The top of the activation record instance of the static parent The top of the activation record instance of the dynamic parent The bottom of the activation record instance of the dynamic parent

The bottom of the activation record instance of the static parent

In deep binding, the referencing environment for executing a subprogram passed as a parameter is:

The environment of the definition of the passed subprogram

Which of the following statements are true for a grammar which has the following rules? A --> ab A --> bC A --> bA The grammar is left recursive The grammar is right recursive The grammar does not pass the pairwise disjointness test The grammar is not top-down parsable

The grammar is right recursive The grammar does not pass the pairwise disjointness test The grammar is not top-down parsable

What disadvantage does UNIX have as a software development environment? It does not include a sufficient number of different development tools It is too slow The interfaces to different utilities are different It only works on certain machines

The interfaces to different utilities are different

Aliases can be created by which of the following language constructs? Whole array operators Assignment statements The union types of C and C++ Pointer assignments

The union types of C and C++ Pointer assignments

Which of the following is not an advantage of LR parsers? They can detect syntax errors as soon as it is possible They are very easy to construct by hand The LR class of grammars is a superset of the class parsable by LL parsers They will work for nearly all grammars that describe programming languages

They are very easy to construct by hand

What was the primary goal of the design of C++? To make Bjarne Stroustrup rich To allow programs to be organized as they could in SIMULA 67 To add array index range checking to C To provide more general features than C

To allow programs to be organized as they could in SIMULA 67

The purpose of left factoring is

To convert a grammar into one that is top-down parsable

The purpose of left factoring is To convert a grammar into one that is top-down parsable To convert a grammar into one that is bottom-up parsable To convert a grammar into one that is parsable by any method To convert a grammar into one that is unambiguous

To convert a grammar into one that is top-down parsable

Which of the following are not goals of a syntax analyzer? To ensure that the numeric literals in a program are syntactically correct To produce a parse tree or a trace of a parse tree Determine whether a given string is a sentence in the language To recognize the identifiers in a program

To ensure that the numeric literals in a program are syntactically correct To recognize the identifiers in a program

Which of the following is not a factor in readability? Overall simplicity Type checking Orthogonality Control statements

Type checking

What innovation of data structuring was introduced in ALGOL 68 but is often credited to Pascal? Dynamic-length array Rectangular arrays Character string types User-defined data types

User-defined data types

PHP and Python are primarily used for Real-time programming. Systems programming. Scientific programming. Web programming

Web programming

What readability problem is caused by using the same closing reserved word for more than one kind of control statement? if statements can be confused with while statements When such a closing reserved word is found, determining what it terminates requires a careful search of the previous code Comments are more difficult to recognize It is boring to see the same reserved word so often

When such a closing reserved word is found, determining what it terminates requires a careful search of the previous code

Which of the following are markup/programming hybrid languages? Python XHTML XSLT JSP

XSLT JSP

Which of the following sentences cannot be derived using the following grammar: (Hint: look at the terminal symbols) <expr> --> <term> {( + | - ) <term>} <term> --> <factor> {( * | / ) <factor>} <factor> --> a | b | c a + b * c a + ( b + c ) a * b * c ( a - b ) * c

a + ( b + c ) (a-b) * c

Which of the following sentences cannot be derived using the following grammar:(Hint: look at the terminal symbols)<expr> --> <term> {( + | - ) <term>}<term> --> <factor> {( * | / ) <factor>}<factor> --> a | b | c a + b * c a + ( b + c ) * b * c ( a - b ) * c

a + ( b + c ); ( a - b ) * c

COMMON LISP is the most common version of LISP in 1980. the features that were common to all dialects of LISP in 1980. a combination of the features of many 1980s versions of LISP. the lowest level features of LISP in 1984.

a combination of the features of many 1980s versions of LISP.

The pairwise disjointness test applies to:

a non-left recursive grammar

Which of the following is a problem with dynamic scoping? Readability Access to nonlocal variables takes longer Static type checking may not be possible

all of the above

Two of the ways in which ML differs from Scheme are the action of the Scheme COND function is performed by the CONDITIONAL function of ML. although Scheme is essentially typeless, ML is strongly typed. the syntax of Scheme is completely different from that of ML ML supports object-oriented programming, but Scheme does not.

although Scheme is essentially typeless, ML is strongly typed. the syntax of Scheme is completely different from that of ML

The first LISP interpreter was written to substantiate the claim that LISP was universal. to prove that LISP could be implemented. as an implementation of the EVAL LISP function. to provide a LISP programming environment.

as an implementation of the EVAL LISP function.

The original version of LISP included the following data types: atoms arrays floats lists

atoms lists

Perl was originally based on which two of the following languages? tk awk sh tcl

awk sh

Side effects usually occur when a function:

changes some its parameters changes a global variable

BNF is identical to:

context-free grammars

What kind of array is defined in the following Java definition: int[] a = new int[10];

fixed heap-dynamic array

Which of the following are lexemes in Java? for semicolon ++ int_literal

for ++

What primitive control statement often is used to build more complicated control statements in languages that lack them? swhich for while goto

goto

Which of the following are terminal symbols in the grammar rule: <factor> -> (++ | --) ident | (+ | -) (ident | int_literal) | (<expr>) ident ++ <expr> int_literal

ident ++ int_literal

What is coercion?

implicit conversion done by the compiler

Which of the following conversions are narrowing? float to double double to float int to byte byte to int

int to byte double to float

The two features that best characterize Haskell are lazy evaluation. a unique syntax its special use of reserved words. list comprehensions.

lazy evaluation. list comprehensions.

Referential transparency means that all references are visible in a program, regardless of where they are declared. the execution of a function always produces the same result, given the same parameters. references in functional programming languages are simple to understand. there are no references to variables that are not visible.

the execution of a function always produces the same result, given the same parameters.

The control flow mechanisms of Scheme are based on the control flow statements of Fortran. those of mathematical functions. the predicate functions of the ENIAC computer. the instruction set of the IBM 709 computer.

those of mathematical functions.

The two purposes of the Scheme function, DEFINE, are to bind the values of expressions to names. to define new data structures. to bind a lambda expression to a name. to provide an assignment statement in Scheme, exactly like those of the imperative languages.

to bind the values of expressions to names. to bind a lambda expression to a name.

The purpose of the Scheme QUOTE function is to provide double quotes around a given string literal. to provide famous quotations for the chapter openers of textbooks. to prevent EVAL from evaluation some parameters in function calls. to form block quotes around paragraphs of text

to prevent EVAL from evaluation some parameters in function calls.

If functions are compiled separately from the main program in C++, which of the following function definitions are valid? void fun(int mat [ ] [ ]) {...} void fun(int mat [5] [10]) {...} void fun(int mat [ ] [10]) {...} void fun(int mat [5] [ ]) {...}

void fun(int mat [5] [10]) {...} void fun(int mat [ ] [10]) {...}

Which of the following are tokens in Java? identifier while mult_op }

while mult_op }

Which of the following expressions allow short-circuit evaluation? x && y x + y x || y x - y

x && y x || y

What is the weakest precondition for the following assignment statement: x = y * 2 + 10 { x > 20}

y > 5

What is the weakest precondition for the following assignment statement: x = y * 2 + 10 { x > 20} x = 5 x > 5 y > 5 y = 5

y > 5


Conjuntos de estudio relacionados

Histoire révision Brevet Chapitre 1

View Set

Pharmacology Chapter 57 GI Secretion Drugs 1-4

View Set

AS 356 Final Exam Review (Exams 1,2,3)

View Set

Object Manager & Lightning App Builder

View Set

생활 스페인어 중간 (문장)

View Set

RN Nursing Care of Children Online Practice 2019 B

View Set

Chap 36 Davis Advantage / Edge - Seizures

View Set