Set No. Code No:221501 II B.Tech.

, II-Semester Supplementary Examinations, November-2003 PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Systems Engineering) Time: 3hours Max.Marks:80 Answer any FIVE questions All questions carry equal marks ---1.a) b) 2.a) b) 3.a) b) 4.a) b) 5.a) b) 6.a) b) 7.a) b) 8. Write the rules for translating BNF into syntax graphs. Give suitable examples. What are the major differences between procedure-oriented and object-oriented programming. What is a variable ? What are its components? Explain how conditional statements are implemented in ALGOL-60, PL/1, and C languages. Distinguish type coercion and type equivalence. What are different structured data types. Give a typical ALGOL 68 record declaration. Distinguish the following parameter passing methods with suitable examples. (i) Call by value (ii) Call by reference (iii) Call by name Discuss different parameter passing mechanisms in ADA. Explain the dynamic scoping in programming languages, with a suitable example. Define a liasing. Explain its merits and demerits. Explain briefly how exception handling is carried out in PL/1. What is meant by abstract data type? Give an abstract specification for queue. Distinguish between semaphore and monitor. How monitor is implemented in CSP/K. Briefly explain the following: (a) BNF Notation (b) Logic programming (c) Semaphore. !!!!!

1

Set No. Code No:221501 II B.Tech., II-Semester Supplementary Examinations, November-2003 PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Systems Engineering) Time: 3hours Max.Marks:80 Answer any FIVE questions All questions carry equal marks ---1.a) b) 2.a) b) 3.a) b) 4.a) b) 5.a) b) 6.a) b) 7.a) b) 8. What is meta language. Demonstrate BNF description of the ALGOL-60 ‘for’ statement. Draw the syntax graph for ALGOL-60 ‘for’ statement. Distinguish between static and dynamic allocation of memory. Explain different conditional statements in ALGOL-68 and C languages. What are the characteristics of enumerated data type. Give an example using Pascal language. What are the design issues in pointer data types. What are its merits and demerits. Define ahasing. What are its merits and demerits? Explain different parameter passing methods permissible in C language. Distinguish between parameter passing by name and parameter passing by text. What is scope and extent? Explain the dynamic scoping rule. What is coroutine? Which languages support it? Distinguish coroutine and procedure. Define abstract data type. Give an abstract specification of binary search tree. What is semaphore? Explain how a binary semaphore is implemented. Give a solution to producer-consumer problems using monitors. Briefly explain the following : (a) Monitors (b) Message passing (c) Generic functions. !!!!!

2

Set No. Code No:221501 II B.Tech., II-Semester Supplementary Examinations, November-2003 PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Systems Engineering) Time: 3hours Max.Marks:80 Answer any FIVE questions All questions carry equal marks ---1.a) b) 2.a) b) 3.a) b) 4.a) b) 5.a) b) 6.a) b) 7.a) b) 8. What are the salient features of a programming language? Explain with suitable examples, how different BNF descriptions are converted into syntax graphs. What is the difference between static binding and dynamic binding? Demonstrate with a suitable example. List and explain different conditional statements in Pascal and ADA. Explain the string processing features available in SNOBOL language with suitable examples. What is dangling pointer ? When does it occur? Distinguish between scope and extent ? Explain the following parameter passing methods with suitable examples. (i) Call by value (ii) Call by reference (iii) Call by value-result. Distinguish between subroutine and function. What is generic function. Give a suitable example. What are various design issues of exception handling? Explain how the exception handling is implemented in PL/1. What is the objective of monitor? Explain how the monitor is implemented in SIMULA. What is concurrency ? Briefly explain the concurrency features in ADA. Briefly explain the following : (a) Basics of LISP (b) Type equivalence (c) Coroutine. !!!!!

3

Set No. Code No:221501 II B.Tech., II-Semester Supplementary Examinations, November-2003 PRINCIPLES OF PROGRAMMING LANGUAGES (Computer Science and Systems Engineering) Time: 3hours Max.Marks:80 Answer any FIVE questions All questions carry equal marks ---1.a) b) 2.a) b) 3.a) b) 4.a) b) 5. 6.a) b) 7.a) b) 8. Write the BNF description of ‘for’ statement in ALGOL-68 language. Define syntax, semantics and pragmatics of a language. Distinguish the following : (i) Compile time (ii) Link time (iii) Load time (iv) Run time. Explain how ‘for’ statement is implemented in ADA, Pascal and C languages. What is type coercion. How the issue of coercion handled in Pascal, ALGOL-68 and ADA. Distinguish array and record? Give an example of C record (structure) declaration. Distinguish between static scope and dynamic scope. What is activation record. Briefly explain its role while program execution. What are different parameter passing mechanisms? examples. Demonstrate with suitable

4

List and briefly explain different exception handlers available in ADA. How is raising an exception different from procedure invocation. Explain how message passing is achieved in ADA, between two tasks. Give a solution to producer-consumer problem using monitors. Write short notes on : (a) Functional programming (b) Function overloading (c) Semaphore. !!!!!