You are on page 1of 5

Code No: 35029 Set No.

1
III B.Tech I Semester Supplimentary Examinations, May/Jun 2009
PRINCIPLES OF PROGRAMMING LANGAUGES
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Give an example of how aliasing deters reliability.


(b) Explain with examples how syntactic design choices affect readability.
(c) Describe any one method for bridging the gap between high-level language
and machine language . [4+6+6]
2. (a) In what fundamental way do operational semantics and denotational semantics
differ?
(b) What are the difficulties in using an attribute grammar to describe all of the
syntax and static semantics of a contemporary programming language?
(c) Explain with an example how operator associativity can be incorporated in
grammars. [5+5+6]
3. (a) How can enumeration types be implemented in languages that do not have
enumeration types and what are the problems associated with such imple-
mentations?
(b) What are the advantages and disadvantages of static variables?
(c) Explain pointers in C and C++ . [4+6+6]
4. (a) Explain in detail assignment statements.
(b) How are Boolean values represented in C based languages and what is the
problem associated with the representation?
(c) Explain in detail iteration based on data structures. [5+5+6]
5. (a) Explain the design issues of subprogram.
(b) Differentiate between pass-by-result and pass-by-value-result. [8+8]
6. (a) What is friend function? What is friend class?
(b) What is the reason java doesn’t have friend functions or friend classes? [8+8]
7. (a) Describe the exception handling in C++.
(b) Explain how backtracking works in prolog. [8+8]
8. (a) Discuss the operations on atoms, operations of lists available in LISP.
(b) List the standard predicates available in most LISP implementation. [8+8]

⋆⋆⋆⋆⋆

1 of 1
Code No: 35029 Set No. 2
III B.Tech I Semester Supplimentary Examinations, May/Jun 2009
PRINCIPLES OF PROGRAMMING LANGAUGES
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) What are the factors that influence programming language design?
(b) Explain in detail various phases in the process of compilation. [8+8]
2. (a) Prove that the following program is correct provide validations.
{n > 0}
count=n;
sum=0;
while count <> 0 do
sum=sum+count;
count=count-1;
end
{sum = 1 + 2............n}

(b) Write CFG for the language consisting of strings that have n copies of the
letter a followed by the same number of copies of the letter b, where n >0.
Draw the parse trees for the sentences aabb and aaaabbbb, as derived from
the grammar. [8+8]
3. (a) What are the problems associated with using classes in Java for implementing
enumeration types?
(b) What must be the descriptors for static character strings, limited dynamic
strings, and dynamic length strings?
(c) Define strong typing. Discuss how type checking is enforced in Fortran 95,
Ada, C, C++, and Java. What do you mean by coercion, how does it effect
strongly typed languages? [ 4+4+8]
4. (a) What are the advantages and disadvantages of allowing mixed-mode arith-
metic expressions?
(b) Assume the following rules of associativity and precedence for expressions:

Precedence : Highest *, /, not


+, -, &, mod
- (unary)
=, /=, <, <=, >=, >
and
Lowest or, xor
Associativity : left to right

1 of 2
Code No: 35029 Set No. 2
Show the order of evaluation of the following expressions:
i. a+b*c+d
ii. a*b-1+c
iii. a*(b-1)/c mod d
iv. (a-b)/c & (d*e/a-3)
(c) Explain in detail multiple selection constructs. [4+4+8]

5. (a) Discuss about actual parameters, positional parameters and keyword parame-
ters.
(b) Explain the general subprogram characteristics. [9+7]

6. (a) Briefly Explain about different types of encapsulation constructs.


(b) How is Struct objects in C# created? Explain with examples. [8+8]

7. (a) Explain why prolog system must do backtracking.


(b) Compare the concept of data typing in an ADA with that of prolog.
(c) What are the three forms of prolog term? [6+6+4]

8. (a) Discuss the operations on atoms, operations of lists available in LISP.


(b) List the standard predicates available in most LISP implementation. [8+8]

⋆⋆⋆⋆⋆

2 of 2
Code No: 35029 Set No. 3
III B.Tech I Semester Supplimentary Examinations, May/Jun 2009
PRINCIPLES OF PROGRAMMING LANGAUGES
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) How do datatypes and structures aid readabililty?


(b) What do you mean by virtual computer?
(c) Can a computer be designed and built with a particular high-level language
as its machine language. Describe the characteristics of such a computer.
[4+4+6]
2. (a) What are weakest preconditions in axiomatic semantics?
(b) Explain two mathematical models of language generation and recognition for
language description.
(c) Define CFG. State whether CFG is a language generator or recognizer. [4+6+6]
3. Explain pointers, reference types, design issues of pointers, operations on pointers,
pointer problems and implementation of pointer and reference types. [16]
4. (a) What is the problem with nesting selectors? How various programming lan-
guages resolved the problem?
(b) Explain in detail guarded commands. [6+10]
5. Discuss the following and compare the merits and demerits of each.
(a) Call- by- value
(b) Call -by- reference
(c) Call-by- Name
(d) Call-by- value results [4+4+4+4]
6. (a) Explain the relative safety of cooperation synchronization using semaphores
and using Ada’s classes in task?
(b) What is the relationship of monitors to Ada tasks for competition synchro-
nization.
(c) Describe Ada 95 Synchronous select class. [6+6+4]
7. Write a prolog program that returns a list containing the union of the elements of
two given lists. [16]
8. (a) Explain structures and arrays in ML give examples.
(b) Discuss briefly about expressions in ML. [8+8]

⋆⋆⋆⋆⋆

1 of 1
Code No: 35029 Set No. 4
III B.Tech I Semester Supplimentary Examinations, May/Jun 2009
PRINCIPLES OF PROGRAMMING LANGAUGES
(Computer Science & Engineering)
Time: 3 hours Max Marks: 80
Answer any FIVE Questions
All Questions carry equal marks
⋆⋆⋆⋆⋆

1. (a) Give an example of two language design criteria that are in direct conflict with
each other.
(b) How is a language implementation system interfaced to the processor?
(c) Is goto a good programming language construct. How does it affect readabil-
ity? [4+6+6]

2. What are different methods for semantic description? Explain with examples. [16]

3. (a) What are the advantages of user-defined data types?


(b) Discuss in detail the primary design issues for names.
(c) Write short notes on integer and floating point numbers in programming lan-
guages. What are the problems associated with storing floating point numbers
in binary? [4+6+6]

4. (a) How does C support relational and Boolean expressions?


(b) Explain with example how operand-evaluation order interacts with functional
side effects.
(c) Discuss in detail overloaded operators. [4+4+8]

5. (a) Distinguish between pass-by-value and pass-by reference.


(b) Explain the characteristics of sub program. [8+8]

6. Discuss how producer-consumer problem and Dining philosophers problem are


solved using concurrency in ADA. [16]

7. Explain the following terms:

(a) Clausal form


(b) Resolution
(c) Fact statements [5+5+6]

8. (a) Explain main features of imperative languages.


(b) Write a LISP function fib(n) that computes nth Fibonacci number. [8+8]

⋆⋆⋆⋆⋆

1 of 1

You might also like