You are on page 1of 4

SET - 1

Code No: 3220506


II B. Tech II Semester Regular Examinations, April/May 2009
PRINCIPLES OF PROGRAMMING LANGUAGES
( Computer Science & Engineering )
Time: 3 hours Max Marks: 80
Answer Any FIVE Questions
All Questions carry equal marks

1. a) Explain the role of programming languages.


b) What are abstract syntax trees? Give an abstract syntax tree for
the expressionb2-4ac.

2. Explain proof rules for following.


a) Rule for statement composition
b) Rule for Simplification
c) Rule for assignment
d) Rule for conditionals

3. a) Briefly explain short-circuit evaluation of Boolean expressions.


b) What is a record? Compare and contrast arrays and records.

4. a) Describe the reason behind memory leaks.


b) Distinguish function procedures from proper procedures. Give the
benefits of procedures.

5. What are formal and actual parameters? What does parameter passing
refers to? Discuss parameter passing methods in Pascal, C and C++.

6. a) Explain the role of constructors and destructors in programs.


b) What are exceptions? How are they handled in C++?

7. a) What are the conditions characterized the Control in Prolog?


Explain each with examples.
b) What is meant by concurrency? How is it achieved in Ada?

8. Write short notes on following.


a) Parse trees
b) Function overloading
c) Benefits of higher level languages
d) Message passing
SET - 2
Code No: 3220506
II B. Tech II Semester Regular Examinations, April/May 2009
PRINCIPLES OF PROGRAMMING LANGUAGES
( Computer Science & Engineering )
Time: 3 hours Max Marks: 80
Answer Any FIVE Questions
All Questions carry equal marks

1. a) Distinguish Functional programming with logic programming.


b) What is meant by syntax and semantics of a language? Explain
their importance in programming.

2. a) Define a loop? How will you handle special cases in loops?


b) What are pre conditions, invariants and post conditions? Give their
role in loops.

3. a) Briefly explain enumeration and sub range data type. Do they


belong to primitive data types or user defined data types? Justify.
b) Differentiate records form variant records with suitable examples.

4. a) Define static binding and dynamic binding. Pascal supports both.


Justify with suitable examples.
b) Briefly explain procedure declaration in Pascal with examples.

5. a) What a macro processor does? Explain macro pre-processors in C.


b) How will you allocate static variables at compile time?

6. a) List various access methods in C++. Give their scope.


b) Explain the concept of Lists in ML.

7. a) What are exceptions? How they are handled in ML?


b) Give applications of functional programming languages. Compare
and contrast functional and imperative languages.

8. Write short notes on following.


a) Syntax charts
b) Templates
c) Imperative programming
d) Java threads.
SET - 3
Code No: 3220506
II B. Tech II Semester Regular Examinations, April/May 2009
PRINCIPLES OF PROGRAMMING LANGUAGES
( Computer Science & Engineering )
Time: 3 hours Max Marks: 80
Answer Any FIVE Questions
All Questions carry equal marks

1. a) List various expression notations used by programming languages.


Explain each with suitable examples.
b) Define Context free grammars. Explain types of grammars.

2. a) What are the constructs used for definite iteration? Give examples.
b) Draw flow diagram for the following program fragment
a) If E1 then S1 b) repeat S until E
Elsif E2 then S2
Else S3
end

3. a) What is coercion? How is it implemented in C?


b) Explain the implementation of sets in Pascal. Give various
operations on sets.

4. a) List the basic rules for type checking.


b) Briefly explain type equivalences in Pascal/Modula-2 and C/C++.

5. a) What is an activation tree? Give elements of an activation record.


b) Briefly explain
- Heap allocation & de-allocation
- Stack allocation & de-allocation

6. a) What are virtual functions? Explain their usage in programs. How


are they implemented in C++?
b) Explain the concept of recurring functions in ML.

7. a) What are exceptions? Give various exception handling mechanisms


in Ada and Java.
b) Explain basic elements of Prolog.

8. Write short notes on following.


a) Scope rules of name
b) Semaphores
c) Inline functions
d) Functional programming
SET - 4
Code No: 3220506
II B. Tech II Semester Regular Examinations, April/May 2009
PRINCIPLES OF PROGRAMMING LANGUAGES
( Computer Science & Engineering )
Time: 3 hours Max Marks: 80
Answer Any FIVE Questions
All Questions carry equal marks

1. a) Define lexical syntax and concrete syntax of a language.


b) What is a BNF grammar? Give BNF grammar for real numbers.

2. a) Define structured programming. Why there is a need to have


structured programming concept?
b) Show that every flow diagram can be implemented using conditional
and while statements if auxiliary Boolean valued variables can be
added.

3. a) What is an array? How is it defined? How relative address and


efficient address are calculated?
b) How pointers are declared in Pascal? Explain various operations on
pointers.

4. a) How will you tell that two type expressions are structurally
equivalent?
b) Give the elements of function procedures in Pascal.

5. Give a simple program fragment that produces different results


under each of the following parameter passing method.
a) Call-by-value
b) Call-by-reference
c) Call-by-value-result
d) Call-by-name

6. a) Explain the concept of parametric polymorphism in ML.


b) ‘Data types can be recursive and polymorphic in ML’. Explain with
suitable example.

7. a) Expand FPL and LISP. Give fundamental and functional features of


both.
b) Give an overview of data structures in Prolog.

8. Write short notes on following.


a) Invariants
b) Monitors
c) Object Oriented Programming
d) Inheritance

You might also like