Font size
WorksheetsSA3 PL
Total questions: 136
Worksheet time: 1hrs 8mins
In context grammar is a special form of context-free are appended to one or
more of its non-terminals in order to provide context-sensitive information.
TRUE
FALSE
In creating a program, the basis for logical decision is called Selection.
TRUE
FALSE
Example: E -> E + T { E.value = E.value + T.value }
The right part of the CFG contains the semantic rules that specify how the
grammar should be interpreted.
TRUE
FALSE
The semantics help interpret symbols, their types, and their relations with
each other.
TRUE
FALSE
The term ________________ help interpret symbols, their types, and their relations with each other.
NONE OF THE ABOVE
SEMANTICS
SYNTACTIC
LEXICAL
The Semantics of a language provide meaning to its constructs, like tokens
and syntax structure.
TRUE
FALSE
If an SDT uses only synthesized attributes, it is called as S-attributed SDT.
TRUE
FALSE
The synthesized attributes get values from the attribute values of their child
nodes.
TRUE
FALSE
Selection is generally in the form of if or case statements.
TRUE
FALSE
In general, loops are more common in imperative languages, while recursion
is more common in functional languages.
TRUE
FALSE
The term loops in programming are considered as ________________.
None of the above
SELECTION
OPTION
ITERATION
An expression such as A * (B + C) / D is usually taken to mean something
like: "First add B and C together, then multiply the result by A, then divide
by D to give the final answer."
TRUE
FALSE
Recursion has no special syntax required.
TRUE
FALSE
Iteration consists of loops and recursion are not considered powerful
component of programming.
TRUE
FALSE
The Attribute grammar is a special form of-context-free _____________ where
some additional information
Grammar
Statement
Syntax
None of the Above
In programming, the other term for selection.
DECISION
None of the Above
OPTION
SETUP
The symbol & is an operator for _________
None of the Above
Bitwise AND
Bitwise XOR
NOT
The symbol ^ is an operator for _________
None of the Above
Bitwise AND
Bitwise XOR
NOT
In programming, the symbol: I I is an operator for ____________.
LOGICAL OR
LOGICAL AND
BITWISE OR
None of the above
In a given program, the symbol (+) are operators use for
ADDITIVE
None of the Above
SUBTRACTION
MULTIPLIED
In programming language, the other term for alternation.
EXECUTION
SELECTION
None of the Above
OPTION
Even if not initially tail recursive, simple transformations can often produce
tail-recursive code known as
None of the Above
CONTINUOUS PASSING
CONTIGUOUS PASSING
CONTINUATION-PASSING
In creating a program, the basis for logical decision is called Selection.
True
False
___________________ is a program transformation technique, which tries to improve the code by making it consume less resources and deliver high speed.
None of the above
CONTROLLED TECHNIQUE
CODE OPTIMIZATION
ITERATION TECHNIQUE
Even if not initially tail recursive, simple transformations can often produce
tail-recursive code known as continuation-passing
TRUE
FALSE
The term ____________ allows program takes one of two courses of action
with certain condition.
SEQUENCE
ITERATION
None of the Above
SELECTION
The multiple declaration of variable in a scope and accessing an out of scope variable are not consider part of semantic errors.
TRUE
FALSE
The attribute grammar can help specify the syntax and semantics of a programming language.
TRUE
FALSE
The typical compiler had two phases: semantic analysis and code __________.
INTERPRETATION
NONE OF THE ABOVE
COMPILER
GENERATION
The semantic misunderstandings arise when people give different meanings to the same words or phrases.
TRUE
FALSE
The term _______ is generally in the form of if or case statements
EXECUTION
NONE OF THE ABOVE
OPTION
SELECTION
The different selection type: if or _________ statements
NONE OF THE ABOVE
FOR CONDITION
SWITCH
CASE
The following symbols: << = > > = are operators use for _____________.
RELATIONAL
NONE OF THE ABOVE
EQUATIONAL
OPERATIONAL
In programming, the == != are operators use for ___________.
UNDEFINED
EQUALITY
NONE OF THE ABOVE
NOT EQUAL
In particular language the && is an operator for __________.
NONE OF THE ABOVE
BITWISE OR
LOGICAL OR
LOGICAL AND
The following symbols: () [] - > . ++ -- are operators use for ________.
PREFIX
NONE OF THE ABOVE
POSTFIX
INFIX
Iteration is probably more efficient than naively written recursion
TRUE
FALSE
Iteration is the most powerful component of programming
TRUE
FALSE
Recursion equally powerful to iteration
TRUE
FALSE
Enumeration-Controlled loop is executed once for every value in a finite set.
TRUE
FALSE
Tail recursion is a special kind of recursion where the recursive call is the very last thing in the function and it's a function that does not do anything at all after recursing.
TRUE
FALSE
A system type which is countable and one dimensional.
STATIC TYPE
ARRAY
DISCRETE
None of the above
A violation of the rules is called a ______.
None of the above
TYPE CHECK
PARITY CHECK
TYPE CLASH
An approach use in collection of values from a domain.
None of the above
DOMAIN APPROACH
DIMENSIONAL
DENOTATIONAL
A type that defines what fields of data will be stored and how that data will be stored.
None of the above
RECORD
DATA SET
DATA TYPE
A ________ typing means that the compiler can do all the checking at compile time types are computed and checked at compile time
STRONG
None of the above
DYNAMIC
STATIC
An approach that includes data contained in relational databases and spreadsheets.
STRUCTURED
None of the above
UNSTRUCTURED
STRUCTURAL
Ada is statically typed.
True
False
Java is ____ typed, with a non-trivial mix of things that can be checked statistically and things that have to be checked dynamically.
None of the above
FIXED
STRONG
DYNAMIC
The ______ are ideally suited to programming in functional and logic languages.
POINTER
LISTS
None of the above
ARRAY
The ____ generally refer to off-line storage implemented by the operating system.
LINK
None of the above
FILES
DRIVE
The strings are really just ___ of characters.
LINK
None of the above
LISTS
ARRAY
In Programming Language, several languages restrict pointers to accessing things in the heap.
TRUE
FALSE
The problems with dangling pointers are due to explicit deallocation of heap objects.
TRUE
FALSE
The term ____ are used with a value model of variables.
None of the above
LISTS
ARRAY
POINTERS
The row pointers avoid multiplication
TRUE
FALSE
The C++ distinguishes that Private class members is accessible just to members of this class.
GENERATION
COMPILER
INTERPRETATION
None of the above
The term Default as one of the type of visibility protection in Java programming means that they are visible to classes in same module.
TRUE
FALSE
The visibility protection in Java is Private when the method is only accessible within the class where it is declared.
TRUE
FALSE
One of the visibility protections called default which is accessible only within the package.
TRUE
FALSE
The SMALLTALK is the canonical object-oriented language.
TRUE
FALSE
In Object Oriented programming it supports data hiding and/or protection.
TRUE
FALSE
The kinds of visibility protection in Java programming: Public, Default, Protected, Private
True
False
The visibility protection in Java is Protected when variable and method are not accessible from each class
True
False
The two reasons to put things in the declaration: programmers can get them and the compiler can understand them.
TRUE
FALSE
One of the visibility protections in Java programming is called Private protection
TRUE
FALSE
The language that has a single inheritance, all methods virtual and has no constructors or destructors is called ___________.
ALGOL68
None of the above
MODULA-3
SMALLTALK
Common Lisp is strongly typed, but not statically typed
True
False
Pascal is almost statistically typed
True
False
An approach use in internal structure of a bunch of data, described down to the level of a small set of fundamental types
Structural
Structured
None of the Above
Unstructured
Collection of values from a "domain"
Denotational Approach
Structural Approach
Implementer's Approach
Abstraction Approach
Collection of well-defined operations that can be applied to objects of that type
Denotational Approach
Structural Approach
Implementer's Approach
Abstraction Approach
A ____________ typing means that the language prevents you from applying an operation to data on which it is not appropriate
STATIC
DYNAMIC
None of the above
STRONG
______ semantics is concerned with finding mathematical objects called domains that represent what programs do
Denotational
Structural
Implementer's
Abstraction
A system type which is used to represent exact fractions (Scheme, Lisp)
RATIONAL
FRACTIONAL
FLOAT
None of the Above
typically 64 bit (double in C); sometimes 32 bit as well (float in C)
RATIONAL
FRACTIONAL
FLOAT
None of the Above
A ________ equivalence is based on some notion of meaning behind those declarations
STRUCTURED
None of the ABove
STRUCTURAL
UNSTRUCTURED
the process of ensuring that a program obeys the type system's type compatibility rules
Type Checking
Coercion
conversion of a value into another of a different data type
Type Checking
Coercion
A ______ equivalence is based on declarations
STRUCTURAL
UNSTRUCTURED
NAME
UNNAMED
is more fashionable these days
STRUCTURAL
UNSTRUCTURED
NAME
UNNAMED
_____ is strong dynamic typed
Common Lisp
Ada
Pascal
Java
Python
_____ is strongly typed, but not statically typed
Common Lisp
Ada
Pascal
Java
Python
_____ is almost statically typed
Common Lisp
Ada
Pascal
Java
Python
Type checking is the process of ensuring that a program obeys the type system's type compatibility rules
True
False
Computers are naturally
RECORD
None of the Above
UNTYPED
DATA SET
Create a set of equivalence classes of declaration of elements and expression that must have exactly the same type is an example of Implementer's approach
True
False
Structured data refers to any data that resides in a fixed field within a record or file
True
False
The contiguous elements and Row pointers are the two layout strategies for arrays
True
False
Row Pointers are an option in Java and allows rows to be put anywhere - nice for big arrays on machines with segmentation problems
True
False
Files may be further categorized into temporary and persistent
True
False
Interactive I/O generally implies communication with human users or physical devices
True
False
Input/Output (I/O) facilities allow a program to communicate with the outside world
True
False
Arrays are the most common and important composite data types
True
False
Unlike records, which group related fields of disparate types, arras are usually heterogeneous
True
False
A slice or section is not a rectangular portion of an array
True
False
In array, global lifetime, statistic shape - If the shape of an array is known at compile time, and if the array can exist throughout the execution of the program, then the _______ can allocate space for the array in static global memory
None of the Above
COMPILER
LINKER
INTERPRETER
in array, local lifetime, static shape - if the shape of the array is known at compile time, but the array should not exist throughout the execution of the program, then space can be allocated in the subroutine's stack frame at run time.
True
False
if the shape of the array is known at compile time, but the array should not exist throughout the execution of the program, then space can be allocated in the subroutine's stack frame at run time.
global lifetime, static shape
local lifetime, static shape
If the shape of an array is known at compile time, and if the array can exist throughout the execution of the program, then the compiler can allocate space for the array in static global memory
global lifetime, static shape
local lifetime, static shape
A slice or section is a rectangular portion of an _____
ARRAY
STRING
LEXICAL VALUE
None of the Above
The lists can also be used in non-imperative programs
True
False
The lists can also be used in imperative programs
True
False
A list is defined recursively as either the empty list of a pair consisting of an object (which may be either a list or an atom) and another (shorter) list
True
False
In Lisp, in fact, a program is a list, and can extend itself at run time by constructing a list and executing it
True
False
The problems with dangling pointers are due to implicit deallocation of elaborated objects.
TRUE
FALSE
The visibility protection in Java is Public when the variable and method is accessible from all class.
True
False
The language that has mix-in inheritance and all methods virtual are called _____
MODULA-3
C++ LANGUAGE
None of the Above
JAVA
A C++ structure (struct) is simply a class whose members are private by default
True
False
A C++ structure (struct) is simply a class whose members are public by default
True
False
In Object Oriented Programming, the sample of Java programming, it is correct that:
class circle : public shape {......
anybody can convert (assign) a circle* into a shape*
True
False
A language needs a way of defining a class: Name, Superclasses , Fields, and Methods.
TRUE
FALSE
In Object Oriented Programming, the sample of Java programming, it is correct that:
class circle : protected shape {......
only members and friends of circle or its derived classes can convert (assign) a circle* into a shape*
True
False
In Object Oriented Programming, the sample of Java programming, it is correct that:
class circle : private shape {......
only members and friends of circle can convert (assign) a circle* into a shape*
True
False
The Imperative Object-Oriented Languages: C++, Java, C#, and Python programming languages
True
False
OOP is currently ruling. It cross-cuts paradigms: Imperative OO, Functional OO, and Logical OO
True
False
In Object Oriented programming: Fields + Methods = Members of the Class
True
False
The language that has a single inheritance, tagged types, and has no constructors or destructors is called __________.
ALGO68
None of the Above
SMALLTALK
MODULE-3
The visibility protection in Java where variable is only accessible within the class where it is declared.
PUBLIC
PRIVATE
PROTECTED
None of the Above
order of execution
Sequencing
Selection
Iteration
Recursion
expression is defined in terms of (simpler versions of) itself
Sequencing
Selection
Iteration
Recursion
Ada puts and & or at same level
True
False
Postfix operators are written before their operands and evaluated left-to-right
True
False
Commutativity, in Expression Evaluation, is assumed to be safe while Associativity is known to be dangerous
True
False
In programming languages, the associativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses; i.e. in what order each operator is evaluated.
True
False
In programming languages, the commutativity of an operator is a property that determines how operators of the same precedence are grouped in the absence of parentheses; i.e. in what order each operator is evaluated.
True
False
In C programming language, any enumeration-controlled loop can be written as a logically-controlled loop.
TRUE
FALSE
According to Iteration, the term for the type of loop that allows to execute until some Boolean condition depends on value altered in the loop.
ENUMERATION-CONTROLLED
ITERATION CONTROLLED
None of the above
LOGICALLY-CONTROLLED
C, Pascal, and Ada are value-oriented languages
True
False
C, Pascal, and Ada are reference-oriented languages
True
False
Lisp, Scheme and ML are reference-oriented languages
True
False
__ is halfway in-between of value-oriented languages and reference-oriented languages
ALGOL-68
C
PASCAL
CLU
Expressions always produce a value, and may or may not have a
side effect.
True
Flase
The Modula-3 allows methods static by default can define a parameter or pointer that grabs the object-specific version of all methods.
True
Flase
In Ada 95, it has single inheritance, no constructors or destructors and class-wide parameters:
True
Flase
A language needs a way of defining a class: Name, Superclasses , Fields, and Methods.
True
Flase
