wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SA3 PL

Total questions: 136

Worksheet time: 1hrs 8mins

Name
Class
Date
1.

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.

a)

TRUE

b)

FALSE

2.

In creating a program, the basis for logical decision is called Selection.

a)

TRUE

b)

FALSE

3.

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.

a)

TRUE

b)

FALSE

4.

The semantics help interpret symbols, their types, and their relations with

each other.

a)

TRUE

b)

FALSE

5.

The term ________________ help interpret symbols, their types, and their relations with each other.

a)

NONE OF THE ABOVE

b)

SEMANTICS

c)

SYNTACTIC

d)

LEXICAL

6.

The Semantics of a language provide meaning to its constructs, like tokens

and syntax structure.

a)

TRUE

b)

FALSE

7.

If an SDT uses only synthesized attributes, it is called as S-attributed SDT.

a)

TRUE

b)

FALSE

8.

The synthesized attributes get values from the attribute values of their child

nodes.

a)

TRUE

b)

FALSE

9.

Selection is generally in the form of if or case statements.

a)

TRUE

b)

FALSE

10.

In general, loops are more common in imperative languages, while recursion

is more common in functional languages.

a)

TRUE

b)

FALSE

11.

The term loops in programming are considered as ________________.

a)

None of the above

b)

SELECTION

c)

OPTION

d)

ITERATION

12.

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."

a)

TRUE

b)

FALSE

13.

Recursion has no special syntax required.

a)

TRUE

b)

FALSE

14.

Iteration consists of loops and recursion are not considered powerful

component of programming.

a)

TRUE

b)

FALSE

15.

The Attribute grammar is a special form of-context-free _____________ where

some additional information

a)

Grammar

b)

Statement

c)

Syntax

d)

None of the Above

16.

In programming, the other term for selection.

a)

DECISION

b)

None of the Above

c)

OPTION

d)

SETUP

17.

The symbol & is an operator for _________

a)

None of the Above

b)

Bitwise AND

c)

Bitwise XOR

d)

NOT

18.

The symbol ^ is an operator for _________

a)

None of the Above

b)

Bitwise AND

c)

Bitwise XOR

d)

NOT

19.

In programming, the symbol: I I is an operator for ____________.

a)

LOGICAL OR

b)

LOGICAL AND

c)

BITWISE OR

d)

None of the above

20.

In a given program, the symbol (+) are operators use for

a)

ADDITIVE

b)

None of the Above

c)

SUBTRACTION

d)

MULTIPLIED

21.

In programming language, the other term for alternation.

a)

EXECUTION

b)

SELECTION

c)

None of the Above

d)

OPTION

22.

Even if not initially tail recursive, simple transformations can often produce

tail-recursive code known as

a)

None of the Above

b)

CONTINUOUS PASSING

c)

CONTIGUOUS PASSING

d)

CONTINUATION-PASSING

23.

In creating a program, the basis for logical decision is called Selection.

a)

True

b)

False

24.

___________________ is a program transformation technique, which tries to improve the code by making it consume less resources and deliver high speed.

a)

None of the above

b)

CONTROLLED TECHNIQUE

c)

CODE OPTIMIZATION

d)

ITERATION TECHNIQUE

25.

Even if not initially tail recursive, simple transformations can often produce

tail-recursive code known as continuation-passing

a)

TRUE

b)

FALSE

26.

The term ____________ allows program takes one of two courses of action

with certain condition.

a)

SEQUENCE

b)

ITERATION

c)

None of the Above

d)

SELECTION

27.

The multiple declaration of variable in a scope and accessing an out of scope variable are not consider part of semantic errors.

a)

TRUE

b)

FALSE

28.

The attribute grammar can help specify the syntax and semantics of a programming language.

a)

TRUE

b)

FALSE

29.

The typical compiler had two phases: semantic analysis and code __________.

a)

INTERPRETATION

b)

NONE OF THE ABOVE

c)

COMPILER

d)

GENERATION

30.

The semantic misunderstandings arise when people give different meanings to the same words or phrases.

a)

TRUE

b)

FALSE

31.

The term _______ is generally in the form of if or case statements

a)

EXECUTION

b)

NONE OF THE ABOVE

c)

OPTION

d)

SELECTION

32.

The different selection type: if or _________ statements

a)

NONE OF THE ABOVE

b)

FOR CONDITION

c)

SWITCH

d)

CASE

33.

The following symbols: << = > > = are operators use for _____________.

a)

RELATIONAL

b)

NONE OF THE ABOVE

c)

EQUATIONAL

d)

OPERATIONAL

34.

In programming, the == != are operators use for ___________.

a)

UNDEFINED

b)

EQUALITY

c)

NONE OF THE ABOVE

d)

NOT EQUAL

35.

In particular language the && is an operator for __________.

a)

NONE OF THE ABOVE

b)

BITWISE OR

c)

LOGICAL OR

d)

LOGICAL AND

36.

The following symbols: () [] - > . ++ -- are operators use for ________.

a)

PREFIX

b)

NONE OF THE ABOVE

c)

POSTFIX

d)

INFIX

37.

Iteration is probably more efficient than naively written recursion

a)

TRUE

b)

FALSE

38.

Iteration is the most powerful component of programming

a)

TRUE

b)

FALSE

39.

Recursion equally powerful to iteration

a)

TRUE

b)

FALSE

40.

Enumeration-Controlled loop is executed once for every value in a finite set.

a)

TRUE

b)

FALSE

41.

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.

a)

TRUE

b)

FALSE

42.

A system type which is countable and one dimensional.

a)

STATIC TYPE

b)

ARRAY

c)

DISCRETE

d)

None of the above

43.

A violation of the rules is called a ______.

a)

None of the above

b)

TYPE CHECK

c)

PARITY CHECK

d)

TYPE CLASH

44.

An approach use in collection of values from a domain.

a)

None of the above

b)

DOMAIN APPROACH

c)

DIMENSIONAL

d)

DENOTATIONAL

45.

A type that defines what fields of data will be stored and how that data will be stored.

a)

None of the above

b)

RECORD

c)

DATA SET

d)

DATA TYPE

46.

A ________ typing means that the compiler can do all the checking at compile time types are computed and checked at compile time

a)

STRONG

b)

None of the above

c)

DYNAMIC

d)

STATIC

47.

An approach that includes data contained in relational databases and spreadsheets.

a)

STRUCTURED

b)

None of the above

c)

UNSTRUCTURED

d)

STRUCTURAL

48.

Ada is statically typed.

a)

True

b)

False

49.

Java is ____ typed, with a non-trivial mix of things that can be checked statistically and things that have to be checked dynamically.

a)

None of the above

b)

FIXED

c)

STRONG

d)

DYNAMIC

50.

The ______ are ideally suited to programming in functional and logic languages.

a)

POINTER

b)

LISTS

c)

None of the above

d)

ARRAY

51.

The ____ generally refer to off-line storage implemented by the operating system.

a)

LINK

b)

None of the above

c)

FILES

d)

DRIVE

52.

The strings are really just ___ of characters.

a)

LINK

b)

None of the above

c)

LISTS

d)

ARRAY

53.

In Programming Language, several languages restrict pointers to accessing things in the heap.

a)

TRUE

b)

FALSE

54.

The problems with dangling pointers are due to explicit deallocation of heap objects.

a)

TRUE

b)

FALSE

55.

The term ____ are used with a value model of variables.

a)

None of the above

b)

LISTS

c)

ARRAY

d)

POINTERS

56.

The row pointers avoid multiplication

a)

TRUE

b)

FALSE

57.

The C++ distinguishes that Private class members is accessible just to members of this class.

a)

GENERATION

b)

COMPILER

c)

INTERPRETATION

d)

None of the above

58.

The term Default as one of the type of visibility protection in Java programming means that they are visible to classes in same module.

a)

TRUE

b)

FALSE

59.

The visibility protection in Java is Private when the method is only accessible within the class where it is declared.

a)

TRUE

b)

FALSE

60.

One of the visibility protections called default which is accessible only within the package.

a)

TRUE

b)

FALSE

61.

The SMALLTALK is the canonical object-oriented language.

a)

TRUE

b)

FALSE

62.

In Object Oriented programming it supports data hiding and/or protection.

a)

TRUE

b)

FALSE

63.

The kinds of visibility protection in Java programming: Public, Default, Protected, Private

a)

True

b)

False

64.

The visibility protection in Java is Protected when variable and method are not accessible from each class

a)

True

b)

False

65.

The two reasons to put things in the declaration: programmers can get them and the compiler can understand them.

a)

TRUE

b)

FALSE

66.

One of the visibility protections in Java programming is called Private protection

a)

TRUE

b)

FALSE

67.

The language that has a single inheritance, all methods virtual and has no constructors or destructors is called ___________.

a)

ALGOL68

b)

None of the above

c)

MODULA-3

d)

SMALLTALK

68.

Common Lisp is strongly typed, but not statically typed

a)

True

b)

False

69.

Pascal is almost statistically typed

a)

True

b)

False

70.

An approach use in internal structure of a bunch of data, described down to the level of a small set of fundamental types

a)

Structural

b)

Structured

c)

None of the Above

d)

Unstructured

71.

Collection of values from a "domain"

a)

Denotational Approach

b)

Structural Approach

c)

Implementer's Approach

d)

Abstraction Approach

72.

Collection of well-defined operations that can be applied to objects of that type

a)

Denotational Approach

b)

Structural Approach

c)

Implementer's Approach

d)

Abstraction Approach

73.

A ____________ typing  means that the language prevents you from applying an operation to data on which it is not appropriate

a)

STATIC

b)

DYNAMIC

c)

None of the above

d)

STRONG

74.

______ semantics is concerned with finding mathematical objects called domains that represent what programs do

a)

Denotational

b)

Structural

c)

Implementer's

d)

Abstraction

75.

A system type which is used to represent exact fractions (Scheme, Lisp)

a)

RATIONAL

b)

FRACTIONAL

c)

FLOAT

d)

None of the Above

76.

typically 64 bit (double in C); sometimes 32 bit as well (float in C)

a)

RATIONAL

b)

FRACTIONAL

c)

FLOAT

d)

None of the Above

77.

A ________ equivalence is based on some notion of meaning behind those declarations

a)

STRUCTURED

b)

None of the ABove

c)

STRUCTURAL

d)

UNSTRUCTURED

78.

the process of ensuring that a program obeys the type system's type compatibility rules

a)

Type Checking

b)

Coercion

79.

conversion of a value into another of a different data type

a)

Type Checking

b)

Coercion

80.

A ______ equivalence is based on declarations

a)

STRUCTURAL

b)

UNSTRUCTURED

c)

NAME

d)

UNNAMED

81.

is more fashionable these days

a)

STRUCTURAL

b)

UNSTRUCTURED

c)

NAME

d)

UNNAMED

82.

_____ is strong dynamic typed

a)

Common Lisp

b)

Ada

c)

Pascal

d)

Java

e)

Python

83.

_____ is strongly typed, but not statically typed

a)

Common Lisp

b)

Ada

c)

Pascal

d)

Java

e)

Python

84.

_____ is almost statically typed

a)

Common Lisp

b)

Ada

c)

Pascal

d)

Java

e)

Python

85.

Type checking is the process of ensuring that a program obeys the type system's type compatibility rules

a)

True

b)

False

86.

Computers are naturally

a)

RECORD

b)

None of the Above

c)

UNTYPED

d)

DATA SET

87.

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

a)

True

b)

False

88.

Structured data refers to any data that resides in a fixed field within a record or file

a)

True

b)

False

89.

The contiguous elements and Row pointers are the two layout strategies for arrays

a)

True

b)

False

90.

Row Pointers are an option in Java and allows rows to be put anywhere - nice for big arrays on machines with segmentation problems

a)

True

b)

False

91.

Files may be further categorized into temporary and persistent

a)

True

b)

False

92.

Interactive I/O generally implies communication with human users or physical devices

a)

True

b)

False

93.

Input/Output (I/O) facilities allow a program to communicate with the outside world

a)

True

b)

False

94.

Arrays are the most common and important composite data types

a)

True

b)

False

95.

Unlike records, which group related fields of disparate types, arras are usually heterogeneous

a)

True

b)

False

96.

A slice or section is not a rectangular portion of an array

a)

True

b)

False

97.

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

a)

None of the Above

b)

COMPILER

c)

LINKER

d)

INTERPRETER

98.

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.

a)

True

b)

False

99.

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.

a)

global lifetime, static shape

b)

local lifetime, static shape

100.

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

a)

global lifetime, static shape

b)

local lifetime, static shape

101.

A slice or section is a rectangular portion of an _____

a)

ARRAY

b)

STRING

c)

LEXICAL VALUE

d)

None of the Above

102.

The lists can also be used in non-imperative programs

a)

True

b)

False

103.

The lists can also be used in imperative programs

a)

True

b)

False

104.

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

a)

True

b)

False

105.

In Lisp, in fact, a program is a list, and can extend itself at run time by constructing a list and executing it

a)

True

b)

False

106.

The problems with dangling pointers are due to implicit deallocation of elaborated objects.

a)

TRUE

b)

FALSE

107.

The visibility protection in Java is Public when the variable and method is accessible from all class.

a)

True

b)

False

108.

The language that has mix-in inheritance and all methods virtual are called _____

a)

MODULA-3

b)

C++ LANGUAGE

c)

None of the Above

d)

JAVA

109.

A C++ structure (struct) is simply a class whose members are private by default

a)

True

b)

False

110.

A C++ structure (struct) is simply a class whose members are public by default

a)

True

b)

False

111.

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*

a)

True

b)

False

112.

A language needs a way of defining a class: Name, Superclasses , Fields, and Methods.

a)

TRUE

b)

FALSE

113.

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*

a)

True

b)

False

114.

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*

a)

True

b)

False

115.

The Imperative Object-Oriented Languages: C++, Java, C#, and Python programming languages

a)

True

b)

False

116.

OOP is currently ruling. It cross-cuts paradigms: Imperative OO, Functional OO, and Logical OO

a)

True

b)

False

117.

In Object Oriented programming: Fields + Methods = Members of the Class

a)

True

b)

False

118.

The language that has a single inheritance, tagged types, and has no constructors or destructors is called __________.

a)

ALGO68

b)

None of the Above

c)

SMALLTALK

d)

MODULE-3

119.

The visibility protection in Java where variable is only accessible within the class where it is declared.

a)

PUBLIC

b)

PRIVATE

c)

PROTECTED

d)

None of the Above

120.

order of execution

a)

Sequencing

b)

Selection

c)

Iteration

d)

Recursion

121.

expression is defined in terms of (simpler versions of) itself

a)

Sequencing

b)

Selection

c)

Iteration

d)

Recursion

122.

Ada puts and & or at same level

a)

True

b)

False

123.

Postfix operators are written before their operands and evaluated left-to-right

a)

True

b)

False

124.

Commutativity, in Expression Evaluation, is assumed to be safe while Associativity is known to be dangerous

a)

True

b)

False

125.

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.

a)

True

b)

False

126.

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.

a)

True

b)

False

127.

In C programming language, any enumeration-controlled loop can be written as a logically-controlled loop.

a)

TRUE

b)

FALSE

128.

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.

a)

ENUMERATION-CONTROLLED

b)

ITERATION CONTROLLED

c)

None of the above

d)

LOGICALLY-CONTROLLED

129.

C, Pascal, and Ada are value-oriented languages

a)

True

b)

False

130.

C, Pascal, and Ada are reference-oriented languages

a)

True

b)

False

131.

Lisp, Scheme and ML are reference-oriented languages

a)

True

b)

False

132.

__ is halfway in-between of value-oriented languages and reference-oriented languages

a)

ALGOL-68

b)

C

c)

PASCAL

d)

CLU

133.

Expressions always produce a value, and may or may not have a

side effect.

a)

True

b)

Flase

134.

The Modula-3 allows methods static by default can define a parameter or pointer that grabs the object-specific version of all methods.

a)

True

b)

Flase

135.

In Ada 95, it has single inheritance, no constructors or destructors and class-wide parameters:

a)

True

b)

Flase

136.

A language needs a way of defining a class: Name, Superclasses , Fields, and Methods.

a)

True

b)

Flase