Qp1 (1)
Qp1 (1)
B 0400CST424052302 Pages: 3
Module I
11 a) Describe the factors that affect the design of programming language. (6)
b) What is meant by referencing environment of a statement? (8)
Show the referencing environment at the indicated program points (1), (2), (3)
& (4) for the following program segment. Assume that the programming
language is dynamically scoped
void sub1() {
int a, b;
... -------------------- 1
} /* end of sub1 */
void sub2() {
int b, c;
Page 1of 3
0400CST424052302
.. . . --------------------- 2
sub1();
} /* end of sub2 */
void main() {
int c, d;
... -------------------- 3
sub2();
} /* end of main */
OR
12 a) What are the domains of computer applications and their associated languages? (6)
b) Consider the following pseudo code: (8)
x : integer := 1
y : integer := 2
procedure add
x := x + y
procedure second(P : procedure)
x : integer := 2
P()
procedure first
y : integer := 3
second(add)
------- ----main starts here----------
first()
write integer(x)
(a) What does this program print if the language uses static scoping? Give
reasons.
(b) What does it print if the language uses dynamic scoping? Give reasons.
Module II
13 a) Describe the lazy and eager approaches for reclaiming garbage (6)
b) Explain different types of assignment statements. (8)
OR
14 a) What is short circuit evaluation? Give example (6)
b) What is record data type? What are the design issues? How to refer the fields in (8)
record?
Module III
15 a) Write a short note on closure. (6)
b) Explain various parameter passing mechanisms in programming languages. (8)
OR
Page 2of 3
0400CST424052302
Page 3of 3