COSC4331- Structures of Programming Languages

Ace your homework & exams now with Quizwiz!

In scheme, what is the return for (CAR '((A B) C D)

(A B)

In Ada, which operator has the highest precedence?

**

Which programming language does NOT support predefined overloaded subprograms.

C

A polymorphic subprogram takes parameters of different types on different activations.

True

A purely functional programming language does not use variables or assignment statements

True

All C# class instances are heap-dynamic.

True

If we use parse-tree to represent the grammar, the leaves are the terminals.

True

In C, all of the three expressions of for statement are optional.

True

In the same rule, <expression> -> <var> + <var> | <var>-<var> | <var>. which expression could be derived, if <var> -> a | b?

a

What is the primary application area for which Ada was designed?

Embedded systems

What are the two most common forms of user-defined ordinal types?

Enumeration and subrange

An associative array is an ordered collection of data elements that are indexed by an equal number of values called keys.

False

In Java, converting from float data type to long data type is widening conversions.

False

In Prolog, top-down resolution is also called forward chaining.

False

In Scheme, the Boolean literals are 0 for false and 1 for true.

False

In Scheme, the result of EVEN? (/ 9 3) is #t.

False

Keyword parameters match the actual parameters to the formal parameters in the order they are listed:

False

Smalltalk is the first widely used object-oriented programming language.

False

The abstractions in a BNF description are called terminals.

False

The parameters supplied in the call statements are referred to as the formal parameters

False

The semantics of a programming language is the form of its expressions, statements, and program unit.

False

What is the array type declared in Java?

Fixed heap-dynamic array

In Prolog, if we have a rule function(X,Y) :- X < 0, Y is -X. What is the answer for function(5, 5)?

No

In BNF, the symbol | means

OR

What programming languages require type checking of actual vs. formal parameters?

Pascal, Java, Ada

Which parameter passing implementation is used just for out-mode parameters?

Pass-by-result

The first language to fully support object-oriented programming was _________.

Smalltalk

_______ variables are those whose storage binding are created when their declaration statements are elaborated, but whose types are statically bound.

Stack-dynamic

A Prolog term cannot be a _______

Statement

Local variables are defined inside subprograms are ______ and _________ variables

Static, stack-dynamic

In Prolog, if we have a rule function(X,Y) :- X < 0, Y is -X. What is the answer for function(-5, 5)?

Yes

In C, which operator is associated from right NOT left?

unary +

Which is considered as identifiers in a programming language?

All of the above

Which programming language provides unconditional branching goto?

C#

In Java and C#, pointers (or references) are used in stack management.

False

In Scheme, what is the result of (+ 5 (- 4 3) )?

6

Which has the highest precedence of the relational operators in the C language?

<

Which attribute of variable is called l-value?

Address

Which statement is False about the pure virtual function in C++?

An abstract class can be instantiated

Which is NOT a numeric data type?

Boolean

What programming language has dominated business applications over the past 45 years?

COBOL

The Scheme multiple selector is using keyword ________.

COND

Which is NOT a type of lexemes - the lowest level syntactic units?

Classes

________ and _________ grammar classes are very useful for describing the syntax of programming languages.

Context-free, regular

Which name is also used for logic programming languages?

Declarative Language

What programming language does NOT allow the programmer to overload operator symbols.

Java

Which programming language does NOT provide union?

Java

Which programming language was the first widely used language for Unicode characters set?

Java

Which is NOT a difference of ADT between C++ and Java?

Java has private and public clauses in class definitions

What is NOT a problem caused by dynamic scoping?

Need to pass the parameters from one subprogram to another

Scheme is a dialect of ________.

LISP

The Scheme language is a dialect of _____?

LISP

Which programming language is the most important of the functional languages, to achieving widespread use?

LISP

Which is used as the first character for names in most programming languages?

Letter

Which programming language uses dynamic length strings?

Perl

What programming languages support heterogeneous arrays?

Perl and Javascript

For access modifiers, entities that are to be hidden are placed in a _________clause, and visible entities appear in a _______ clause.

Private, public

There are two fundamental abstraction facilities in programming languages?

Process and data

Programming languages can support two distinct categories of abstraction: _______ and _______

Process, data

Logic programming has been used in applications of

Relational database systems and expert systems

Dynamic binding is happening at ________.

Running

The parameter profile of a subprogram does NOT contain _______

The names of the formal parameters

Which is NOT a disadvantage of the logic programming language?

The programmer must understand the ways the rules applied to answer those questions

In the rule, <expression> -> <var> + <var> | <var>-<var> | <var>. Which statement is NOT correct

This rule is recursive.

In Java, strings are supported by the String class, whose values are constant strings.

True

In Prolog, the binding of a value, and thus a type, to a variable is called an instantiation.

True

Java supports only single inheritance, not multiple inheritances.

True

One of the motivations for process abstraction and data abstraction is to against the complexity of programming.

True

Pass-by-value is implementing in-mode semantics.

True

Regular expressions are used to describe sets of valid strings.

True

The referencing environment of a statement is the collection of all of the variables that are visible in that statement.

True

The C# switch statement differs from that of its C-based predecessors in that every selectable segment must end with an explicit unconditional branch statement, either a__________ or a ________.

break, goto

In scheme, which function returns the tail of a list?

cdr

In Java, data abstraction is provided by _________

class

Which iterative statement in C is posttest?

do... while

In most imperative programming languages, binary operators are _______ notation.

infix

_______ is the process by which one class can be created as a special category of another class- get or redefine the variables and methods of the original class.

inheritance

In Scheme, which notation is used to define a function?

lambda

In Prolog, the semi-colon represents _________

or

In Prolog, all statements must end with a ________

period


Related study sets

MED SURG TEST #3 prep-u questions ch 20

View Set

Ch. 11- Outlining the Speech; Ch. 12- Using Language

View Set

HESI A2 Critical Thinking Questions

View Set

Practice: Solving One Step Equations Online Practice

View Set