stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Programming Languages - Exam Review Flashcards | StudBud
Explore
/
Programming Languages - Exam Review
Programming Languages - Exam Review
90 terms
·
StudBud Administration
·
16 plays
Combination of all test multiple choices
Flashcards
90 cards
F
Practice quiz
P
Host live
L
Questions
90
Answers
1
Which is an advantage of OOP languages in which everything is an object?
Elegance and purity
Has two type systems
Fast operations on simple objects
Relatively small typing system
2
What user group was the target of the first version of BASIC?
Scientists
Engineering students
Liberal arts students
Accountants
3
A language is strongly typed if:
Type checking is done at compile-time
Type checking is done at run-time
Type errors are always detected
Its operands and operators are of compatible types
4
Which one of the following languages uses the fewest number of coercions in arithmetic expressions?
C++
Java
C
Ada
5
Parameterized Abstract Data Types:
are public classes
implemented only for dynamic typed languages
are a hierarchy of classes
are also known as generic classes
6
Which type of subprograms provides parametric polymorphism?
Coroutines
Overloaded subprograms
Generic subprograms
Subprograms with only out parameters
7
HPF is a language for concurrency based on what other language?
Both a and c
C
Fortran
Java
8
The form of symbolic logic used for logic programming is called:
predicate calculus
logic calculus.
lambda calculus.
propositional calculus.
9
The lambda expression for h (x) ≡ x * x is:
λ(x) x2
λ(x) x * x
λ(x) x x *
λ(x) * x x
10
Which of the following is not a choice for the binding of a passed subprogram to its correct referencing environment?
Ad hoc binding
Shallow binding
Backwards binding
Deep binding
11
Which one of the following is not a semantic model for parameter passing?
Out mode
In mode
Inout mode
Pass by reference
12
Which category of programming languages' structure is dictated by the von Neumann computer architecture?
Functional
Systems
Imperative
Scientific
13
Which is true about functional programming languages?
Efficiency is the primary concern
Mimics mathematical functions
Declarative rather that procedural
Programming is non-procedural
14
In a subprogram’s ARI the pointer to the base of the activation record instance of the caller is the:
dynamic chain
environment pointer
Static chain
dynamic link
15
What characteristic of Java is most evident in JavaScript? (choose one)
Semantics
Object orientation
Strong typing
Syntax
16
Which of the following is not a primary design issue for arithmetic expressions?
What are the operator associativity rules?
Should array elements be allowed to be operands?
Does the language allow user-defined operator overloading?
What is the order of operand evaluation?
17
Vector processors are
SIMD machines
multiple complete processor machines.
uniprocessor machines
MIMD machines
18
Competition synchronization is provided in monitors
using semaphores
implicitly in the implementation
using the queue data type.
using the delay operation.
19
A Java event listener is
a protocol for an event handler
a predefined method that monitors events
an event handler.
a user-defined method that monitors events
20
Which one of the following is not a primitive data type?
Integer
A single-dimensional array of integers
Boolean
Floating point
21
Which is not a general characteristic of subprograms?
has a single entry point
caller suspended during subprogram execution
return value on termination
control always returns to caller
22
What role does the symbol table play in a compiler?
Stores the reserved words
Records the number of syntax errors
Serves as the database of information about the program
Allows high-quality error messages
23
Which one is not a variable attribute?
lifetime
alias
address
scope
24
What construct of a programming language provides process abstraction?
classes
arrays
subprograms
pointers
25
The order in which adjacent operators with the same precedence level are evaluated is defined by:
operand evaluation order
operator associativity rules
operator precedence rules
operator overloading
26
Which of the following is not a state in which a task can be?
Live
Runnable
Dead
Running
27
Which is NOT a disadvantage of Multiple Inheritance?
Language complexity
Diamond inheritance
Potential inefficiency
Decreased code flexibility
28
What do the Ada and COBOL languages have in common?
Both are for scientific applications
Both were forced on users by DoD
Both took a long time to develop
Both are for business applications
29
A pointer maintained by the run-time system pointing to the base of the ARI of the currently executing program is:
environment pointer
Static chain
dynamic chain
dynamic link
30
BNF abstractions are represented by:
Sentences
Terminal symbols
Non-terminal symbols
Rules
31
Guarded Command Language (GCL) is the basis for linguistic mechanisms for concurrent programming in:
C
Ruby
ML
Ada
32
Which one of the following is a terminal symbol in the grammar rule:< expr > → (+ | -) ident | ident | (< expr >)
ident
< expr >
--
++
33
What construct of a programming language provides process abstraction? (choose one)
arrays
subprograms
classes
pointers
34
Which one of the following is considered a deficiencies of Prolog as a logic programming language?
The use of negative logic prevents any positive conclusions
It runs too slow on RISC-based computers.
It is a true/false system rather than a true/fail system.
User can order statements to optimize efficiency.
35
In which language are exceptions not named?
C++
Ada
C
Java
36
Which one of the following languages does not allow dynamic binding of values to named constants?
Java
C++
Fortran 95
Ada
37
Which of the following involves explicit type conversions?
widening conversion
casting
coercion
mixed mode expression
38
A grammar is ambiguous if it: (choose one)
Produces a sentential form that has two distinct parse trees
Has a rule with more than four RHSs
Has rules with the same LHS and RHS
Has two rules that have the same RHSs
39
The for statement is an example of a:
Two-Way Selection
Counter-Controlled Loop
Multiple-Way Selection
Logically-Controlled Loop
40
Which one of the following is not a primary design issue for pointers?
What is the lifetime of a heap-dynamic variable?
Should the language support pointer types, reference types, or both?
Can pointers point to other pointers?
Are pointers restricted as to the type of value to which they can point?
41
Which is a characteristic of Shallow Access for Dynamic Scoping?
One stack for all variable names
Every activation record instance must have variable names
Fast with references to distant non-locals
Fast for program linkage
42
A headed Horn clause is a proposition with:
empty left side.
a single atomic proposition on the right side.
a single atomic proposition on the left side
empty right side.
43
Which one of these languages have case-sensitive names?
C
Fortran
Ada
COBOL
44
Which of the following is not a design issue for object-oriented languages?
Single versus multiple inheritance
Are methods required to return only objects?
The exclusivity of objects
Are subclasses subtypes?
45
The first LISP interpreter was written:
to prove that LISP could be implemented.
to provide a LISP programming environment.
as an implementation of the EVAL LISP function
to substantiate the claim that LISP was universal
46
In which of the following languages are exceptions implicitly raised?
C++
Ada
C
Java
47
What is the key difference between static and dynamic scoping? (choose one)
Static scoping is more reliable but at the expense of readability
Are based on temporal and spatial relationships of subprograms respectively
The scope of a variable can be determined prior to execution
Dynamic scoping is more flexible and efficient
48
Which of the following is not one of the three fundamental concepts of OOP?
Dynamic binding
Abstract data types
Static binding
Inheritance
49
Declarative semantics of a statement means:
the meaning of all statements depend on variable declarations.
same thing as the semantics of expressions in imperative languages.
the types of all of its declared variables.
the meaning of a statement does not depend on how the statement is used.
50
On what language was COBOL based?
ALGOL 58
LISP
FORTRAN
FLOW-MATIC
51
Which of the following is not an advantage of having exception handling built in to a language?
allows single handlers to deal with exceptions in different subrograms
It can simplify the handling of unusual, but not erroneous events.
It can considerably simplify programs by implicit error checking
Languages with exception handling are simpler than those without it.
52
The fundamental process of proving a subgoal is called:
matching.
conjunction building.
backtracking.
unification.
53
Which one is not an attribute type of Attribute Grammars?
Inherited
Predicate
Intrinsic
Synthesized
54
What is exception handling?
Dealing with the syntactic irregularities of a programming language
Dealing with different ranges of parameter values in a subprogram.
intercepting run-time errors, take corrective measures, continue executions
Dealing with syntax errors during compilation
55
Which is not a possible binding time?
implementation
design
termination
load
56
A primary feature of ADTs is:
Polymorphism
Packaging of data with their associated operations
Inheritance
Methods for parameterized implementations
57
Which of the following is not a design issue for exception handling?
Are there any built-in exceptions?
How are exception occurrences defined?
How are user-defined exceptions specified?
Can built-in exceptions be explicitly raised?
58
The Object Oriented Programming language construct that store the state of an object is the:
Virtual Method Table
Class Instance Record
Object Record Table
Activation Record Instance
59
Which is an example of access control for information hiding provided by some programming languages for ADTs?
public
private
internal
protected
60
Nesting depth is the same as
Static chain
Static depth
Static offset
Chain offset
61
Which of the following is not a natural category of concurrency?
Register level
Statement level
Instruction level
Unit level
62
Which one of the following languages does not have pattern matching built in to the language?
Perl
PHP
JavaScript
Java
63
Which of the following languages uses the fewest number of coercions in arithmetic expressions?
Ada
Java
C++
C
64
What design criterion was used extensively in ALGOL 68? (choose one)
Reliability
Readability
Orthogonality
Simplicity
65
An expression in which there are implicit type conversions is a(n):
mixed mode expression
short circuit evaluation
casting
functional side effect
66
When given a goal with variables, the Prolog system
Attempts to prove the goal is false
Looks up the values of the variables in the current runtime environment
Issues an error message
Uses unification to find variables values that make the goal true
67
Which one of the following may have the form of a headed horn clause?
Fact
Query
Goal Statements
Rule Statements
68
Which is not an element of a guarded command?
guarded clause
iterator
guard
fatbar
69
The purpose of the Scheme QUOTE function is
to prevent EVAL from evaluation some parameters in function calls.
to provide double quotes around a given string literal.
to form block quotes around paragraphs of text.
to provide famous quotations for the chapter openers of textbooks.
70
Which one of the following is not a category of scalar variables defined by their lifetimes?
implicit stack-dynamic
implicit heap-dynamic
stack
explicit heap-dynamic
71
Which one of the following is not a primary design issue for ADTs?
Can abstract data types be nested?
What access controls are provided and how such controls are specified?
Can abstract types be parameterized?
What is the form of the container for the interface to the type?
72
Which one of the following is not an advantage in implementing a language with a pure interpreter?
Storing the whole source program requires significant storage
Source-level debugging operations are easily implemented
Code execution time is very fast
The implementation is relatively simple
73
For which language are tasks heavyweight tasks?
C
Ada
Java
High Performance Fortran
74
Which of the following is not considered advantages that functional languages have over imperative languages?
semantics of functional languages are easier to describe than Imperative
Designing concurrent programs in functional languages is much easier.
They are more execution efficient.
The syntax of functional languages is simpler than imperative languages
75
Which one of the following dynamic semantic methods systems is most mathematical?
Static semantics
Denotational semantics
Operational semantics
Axiomatic semantics
76
Which of the following is not a primary design issue for two-way selectors?
How should the meaning of nested selectors be specified?
How are the then and else clauses specified?
Is the else clause optional, or is it required?
What is the form and type of the expression that controls the selection?
77
A C++ exception handler with an ellipses formal parameter catches
any thrown exception
any thrown exception related to arithmetic.
all thrown exceptions related to tasks.
only exceptions thrown with the statement: throw(...).
78
Which of the following is not a design issue for multiple selection statements?
Is execution restricted to include just a single selectable segment?
What is the form and type of the expression that controls the selection?
What is the max number of selections that can be included in the construct?
How should unrepresented selector expression values be handled, if at all?
79
Which is not a method of providing synchronization?
Tasks
Monitors
Message Passing
Semaphores.
80
The format, or layout, of the local variables and data that can change of an executing subprogram is called the:
activation record
non-code part
actual code
activation record instance
81
Which language uses indentation to define if-then-else clauses?
Ada
Python
Perl
Ruby
82
The original version of LISP included one of the following data types
lists
variables
functions
objects
83
What was the primary application area of computers at the time Fortran was designed?
Business
Computer gaming software
Artificial intelligence
Scientific
84
Context-free grammars were devised by:
Noam Chomsky
Peter Naur
John Backus
John McCarthy
85
Competition synchronization in Ada is provided by
semaphores implemented as auxiliary task.
guards attached to tasks.
the semantics of task execution.
guards attached to select clauses.
86
Which of the following FPLs is essentially typeless?
COMMON LISP
Haskell
Scheme.
ML
87
Referential transparency means that:
references are visible in a program, regardless of where they are declared.
there are no references to variables that are not visible.
a function always produces the same result, given the same parameters
references in functional programming languages are simple to understand.
88
Which one is an eager approach to garbage collection?
tombstones
mark-sweep
reference counters
lock-and-key
89
Which of the following languages has a throws clause?
Java
C++
Ada
C
90
Which one of the following is not a good reason to study programming languages?
Better understanding of the significance of implementation
Increased ability to learn new languages
Increased ability to discuss programming languages
Increased capacity to express ideas