Semester : SEMESTER 7
Subject : Programming Paradigms
Year : 2019
Term : MAY
Branch : COMPUTER SCIENCE AND ENGINEERING
Scheme : 2015 Full Time
Course Code : CS 403
Page:3
b)
14 a)
b)
15 ஐ
b)
10 8)
0)
17 a)
(७1033 Pages: 4
{ {
char name[2]; char name[2];
int age; int age;
float mark; float mark;
} }
Draw the memory layout for the records (1) and (2) for a 32-bit aligned machine.
Explain the difference among strict and loose name equivalence (3)
PART C
Answer any two full questions, each carries 9 marks.
Describe four parametric-passing modes. How does a programmer choose a parameter (6)
mode in a particular scenario
Describe three alternative means of allocating co-routine stacks. (3)
What is a subroutine calling sequence? What does it do? What is meant by subroutine (൭)
prologue and epilogue?
How let and letrec constructs work in scheme? (3)
rainy(seattle). (6)
rainy(rochester).
cold(rochester).
snowy(X) :- rainy(X), cold(X).
From the above facts and rules, explain the backtracking strategy in Prolog.
Draw a DFA to accept all strings of zeros and ones containing an even number of (3)
each. How a Scheme interpreter works in this case?
PART 0
Answer any two full questions, each carries 12 marks.
Generate strings and output from the following pattern (9)
/a(bc)?/
18(00*/
/a(bc){3}/
13(00)(2,)/
18(00(1,3)/
10136104 ]6/
/Ox[0-9a-fA-F]+/
Sfoo = "albatross";
$foo =" s/[aeiou]/-/g;
9100 = "albatross";
Sfoo =” s/Ibat/c/;
b) Explain the difference between dynamic and static method binding (3)
Page 3084