code no: r22056 r10 set - 1 ii b. tech ii semester regular examinations, august -2014 · pdf...

18
|''|''|||''|'''|||'| Code No: R22056 II B. Tech II Semester Regular Examinations, August -2014 PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT) Time: 3 hours Max. Marks: 75 Answer any FIVE Questions All Questions carry Equal Marks ~~~~~~~~~~~~~~~~~~~~~~~~ 1. a) Compare the process of Compilation and Interpretation. b) What is AST? How it helps in design the Programming language? Give AST for expression A = (B+C) * (D/E) (8M+7M) 2. a) Define the terms: i) life time of the variable ii) Scope and extent b) What is static binding and dynamic binding (8M+7M) 3. What is meant by attributes? Discuss about it. How space can be managed for the attributes? (15M) 4. a) What is recursion? Explain its control flow with suitable example. b) Explain the different forms of statement level sequence control? (8M+7M) 5. a) What is an activation record? What are its content and uses? b) Why type checking is required? Give the alternatives for type checking. Explain. (8M+7M) 6. a) Describe the algorithm used to identify an appropriate handler when an exception is raised in a language. b) Discuss about genetic sub-routines and modules. (8M+7M) 7. With respect to the object oriented programming, briefly explain the following: i) Class and instance ii) Object iii)Virtual function iv) Inheritance (15M) 8. Summarize Prolog’s facilities for database manipulation. Briefly Explain the usage of assert, retract, and clause. (15M) 1 of 1 SET - 1 R10

Upload: duongkhanh

Post on 17-Mar-2018

227 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|''|||''|'''|||'|

Code No: R22056

II B. Tech II Semester Regular Examinations, August -2014

PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) Compare the process of Compilation and Interpretation.

b) What is AST? How it helps in design the Programming language? Give AST for expression

A = (B+C) * (D/E) (8M+7M)

2. a) Define the terms:

i) life time of the variable

ii) Scope and extent

b) What is static binding and dynamic binding (8M+7M)

3. What is meant by attributes? Discuss about it. How space can be managed for the attributes?

(15M)

4. a) What is recursion? Explain its control flow with suitable example.

b) Explain the different forms of statement level sequence control? (8M+7M)

5. a) What is an activation record? What are its content and uses?

b) Why type checking is required? Give the alternatives for type checking. Explain. (8M+7M)

6. a) Describe the algorithm used to identify an appropriate handler when an exception is raised

in a language.

b) Discuss about genetic sub-routines and modules. (8M+7M)

7. With respect to the object oriented programming, briefly explain the following:

i) Class and instance

ii) Object

iii) Virtual function

iv) Inheritance (15M)

8. Summarize Prolog’s facilities for database manipulation. Briefly Explain the usage of assert,

retract, and clause. (15M)

1 of 1

SET - 1 R10

Page 2: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|''|||''|'''|||'|

Code No: R22056

II B. Tech II Semester Regular Examinations, August -2014

PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) What is the significance of studying programming language?

b) Discuss about Context-free grammar and regular expression? Give the parse tree of a

following statement: A = (B+C) * (D / E) (8M+7M)

2. a) Consider the following pseudo code.

Procedure P (A, B: real)

X: real

Procedure Q (B, C: real)

Y: real

. . .

Procedure R (A, C: real)

Z: real

. . . (*)

. . .

Assuming static scope, what is the referencing environment at the location marked by (*)?

b) Define Macro? How to implement the macro? (8M+7M)

3. Explain the following:

i) Attribute grammar

ii) Action routines (15M)

4. a) What is dangling-else problem? Discuss How it can be handled by the programming

language.

b) Describe the characteristics of structured and unstructured control flow. (8M+7M)

5. a) Briefly explain about the Records and the Sets data structures

b) What are primitive and non-primitive data types? Explain. (8M+7M)

6. a) Explain in detailed about the different forms of parameters.

b) Describe how virtual functions can be used to achieve the effect of subroutine closures.

(8M+7M)

7. Why OOP is required? Explain about different types of Inheritance. Explain the importance of

Inheritance. (15M)

8. a) For What sort application logic programming is useful? Briefly explain.

b) What are existential queries? Briefly explain. (8M+7M)

1 of 1

SET - 2 R10

Page 3: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|''|||''|'''|||'|

Code No: R22056

II B. Tech II Semester Regular Examinations, August -2014

PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) What are the main features of the programming paradigm with examples?

b) Define CFG? What does it mean for CFG to be ambiguous? (8M+7M)

2. a) Define data object? Briefly explain the attributes to which a data object may bind to?

b) What is scope? How to implement the scope rules for a variable? (8M+7M)

3. Explain the role of semantic analyzer in design of PL (15M)

4. a) Discuss the following term:

i) Dangling pointers

ii) Tail recursion elimination.

b) Briefly explain about Iterative control statements and its control flow. (8M+7M)

5. a) What is meant by type checking? Differentiate between static type checking and dynamic

type checking and give their relative advantages?

b) What is meant by activation record? Briefly explain its elements. (8M+7M)

6. a) Describe three alternative means of allocating co-routine stacks. What are their relative

strengths and weaknesses?

b) Explain early binding and late binding. (8M+7M)

7. Why OOP is required? List and explain the vocabulary of OOP. (15M)

8. a) What is unification with respect to Prolog? Briefly Explain.

b) What is meant by control in Prolog? Briefly explain. (8M+7M)

1 of 1

SET - 3 R10

Page 4: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|''|||''|'''|||'|

Code No: R22056

II B. Tech II Semester Regular Examinations, August -2014

PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) Explain the two approaches to bridge the gap between High level languages and machine

level languages? Compare.

b) What are the formal methods for describing the syntax of programming languages?

(8M+7M)

2. a) What are the scope rules for designing the programming language

b) Difference between static and dynamic binding. (8M+7M)

3. Discuss about the various attributes of a good language and explain the process of evaluating

attributes with example. (15M)

4. a) Explain the break and continue statements in loops with the help of pseudo code.

b) Explain special cases in loops (8M+7M)

5. a) Discuss the significance of holes in the records. Why they do and what problem do they

cause?

b) Discuss the comparative advantages of structural and name equivalence for types. Name

three languages that use each approach. (8M+7M)

6. a) Explain the various parameter passing methods. Discuss their features.

b) Explain the difference between virtual and non-virtual methods. (8M+7M)

7. a) What is inheritance with respect to OOP? What are its benefits?

b) Differentiate between public and private base classes (8M+7M)

8. Define Functional Programming Language. List the properties of Functional Programming

languages and describe each of them briefly. (15M)

1 of 1

SET - 4 R10

Page 5: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|'||'|''|''|''''|

Code No: R22056

II B. Tech II Semester Supplementary Examinations, January - 2014

PRINCIPLES OF PROGRAMMIG LANGUAGE

(Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) Explain in detail about various language evaluation criteria and the characteristics that

affect them.

b) Explain the process of compilation. (7M+8M)

2. a) Explain in detail about the notion of Binding Time.

b) Explain in detail about an object lifetime and storage management. (7M+8M)

3. Define Attribute grammars. Give an attribute grammar for simple assignment statements. How

is the order of evaluation of attributes determined for the trees of Attribute grammar? (15M)

4. a) Explain in detail about structured and unstructured control flows.

b) Explain in detail about sequencing and recursion control flows with examples. (7M+8M)

5. Explain in detail the following data types:

a) array

b) lists

c) record

d) union and pointer (15M)

6. Briefly explain message passing run-time program management in detail. (15M)

7. Explain in detail about the following concepts in Object Oriented Programming:

a) Encapsulation

b) Multiple inheritances

c) Dynamic Method Binding (5M+5M+5M)

8. a) Explain about functional forms provided in LISP.

b) Discuss about basic elements of Prolog. (7M+8M)

1 of 1

SET - 1 R10

www.jntu

kfastu

pdates.co

m

Page 6: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|'||'|''|''|''''|

Code No: R22056

II B. Tech II Semester Supplementary Examinations, January - 2014

PRINCIPLES OF PROGRAMMIG LANGUAGE

(Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. a) Give important factors that influence the basic design of programming language.

b) Explain in detail about Programming domains and language categories. (8M+7M)

2. a) Define Lifetime, scope, static Scope and dynamic scope. What are the general problems with

static scoping?

b) Discuss on implementation of pointer and reference types. (8M+7M)

3. a) What do you mean by axiomatic semantics? Give the weakest precondition for a sequence of

statements.

b) Explain about stack dynamic variables and explicit heap dynamic variables. (7M+8M)

4. Explain in detail about the following Control Flows with examples:

a) Sequencing

b) Iteration

c) Recursion (5M+5M+5M)

5. a) Explain in detail various design issues of character string types.

b) Explain about pointers in C and C++. (8M+7M)

6. a) Explain in detail about Concurrent programming fundamentals.

b) Explain in detail about Language – level mechanisms. (7M+8M)

7. a) Briefly explain Dynamic Method Binding in Java with example.

b) What are the applications of Logic Programming? (7M+8M)

8. a) Explain Functional Programming concepts in detail.

b) Explain Logic programming concepts in detail. (7M+8M)

1 of 1

SET - 2 R10

www.jntu

kfastu

pdates.co

m

Page 7: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|'||'|''|''|''''|

Code No: R22056

II B. Tech II Semester Supplementary Examinations, January - 2014

PRINCIPLES OF PROGRAMMIG LANGUAGE

(Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. Explain in detail the following programming language implementation:

a) Compilation

b) Virtual Machines

c) Programming environments (5M+5M+5M)

2. a) Explain in detail about the binding of referencing environments.

b) Explain in detail about Macro expansion and separate compilation. (7M+8M)

3. a) Explain in detail about the role of Semantic Analyzer.

b) Explain in detail about the Space management for attributes. (7M+8M)

4. Explain in detail the following Control structures:

a) Compound Statements

b) Unconditional Statements

c) Guarded commands (5M+5M+5M)

5. a) What is type checking? Discuss the various types of type checking.

b) Explain about type compatibility. (8M+7M)

6. a) Explain the basic concepts of exception handling? What are the design issues for exception

handling systems?

b) Why were imperative features added to most dialects of LISP? (8M+7M)

7. Explain in detail about the following concepts in Object Oriented Programming:

i) Encapsulation

ii) Inheritance

iii) Dynamic Method Binding (5M+5M+5M)

8. a) Write the applications of logic programming.

b) Write about the basic elements of PROLOG.

c) What is an exception? (5M+5M+5M)

1 of 1

SET - 3 R10

www.jntu

kfastu

pdates.co

m

Page 8: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

|''|'||'|''|''|''''|

Code No: R22056

II B. Tech II Semester Supplementary Examinations, January - 2014

PRINCIPLES OF PROGRAMMIG LANGUAGE (Com. to CSE, IT)

Time: 3 hours Max. Marks: 75

Answer any FIVE Questions

All Questions carry Equal Marks

~~~~~~~~~~~~~~~~~~~~~~~~

1. Explain in detail the following Programming Language Implementation:

a) Interpretation

b) Context-Free Grammars

c) Programming environments (5M+5M+5M)

2. a) Explain in detail about the Binding of Referencing Environments.

b) Explain in detail about an Object Lifetime and Storage Management. (7M+8M)

3. a) Explain in detail about the procedure of evaluating Attributes.

b) Explain about S-attributed and L-attributed grammar in detail. (7M+8M)

4. a) Explain in detail arithmetic relational and Boolean expressions.

b) Explain in detail assignment statements. (8M+7M)

5. a) Explain type checking techniques in parameter passing.

b) Explain how multidimensional arrays are passed as parameters. (8M+7M)

6. a) What are the three semantic models of parameter passing?

b) Define shallow and deep binding for referencing environments of subprograms that have

been passed as parameters. (8M+7M)

7. Explain in detail about the various concepts in Object Oriented Programming. (15M)

8. a) What is unification? Why is it important in logic programming?

b) Describe the difference between forward chaining and backward chaining. Which chaining

in used in PROLOG by default.

(5M+10M)

1 of 1

SET - 4 R10

www.jntu

kfastu

pdates.co

m

Page 9: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 1

III B.Tech I Semester Regular Examinations, November 2007PRINCIPLES OF PROGRAMMING LANGAUGES

(Computer Science & Engineering)Time: 3 hours Max Marks: 80

Answer any FIVE QuestionsAll Questions carry equal marks

⋆ ⋆ ⋆ ⋆ ⋆

1. (a) What do you mean by a general purpose language. Is C a general purposelanguage?

(b) Explain about von Neumann computer architecture.

(c) What are the three general methods of implementing a programming lan-guage? [4+4+8]

2. (a) In what fundamental way do operational semantics and denotational semanticsdiffer?

(b) What are the difficulties in using an attribute grammar to describe all of thesyntax and static semantics of a contemporary programming language?

(c) Explain with an example how operator associativity can be incorporated ingrammars. [5+5+6]

3. (a) What are the merits of subrange types?

(b) Define strong typing. Discuss how type checking is enforced in Fortran 95,Ada, C, C++, and Java.

(c) Explain associative arrays, their structure and operations. [4+6+6]

4. (a) Explain in detail counter-controlled loops.

(b) Discuss precedence and associativity rules of different programming languages.[8+8]

5. (a) What are advantages and disadvantages of dynamic local variables?

(b) In what ways coroutines different from conventional subprograms?

(c) What is parametric polymorphism? [5+6+5]

6. Explain the following terms :

(a) Message passing

(b) Concurrency in Ada

(c) Monitors [6+5+5]

7. (a) Discuss about basic elements of prolog. Give examples.

(b) Write a prolog description of your family tree (based only on facts),going backto your grand parents and including all descendants. Be sure to include allrelationships. [8+8]

1 of 2

Page 10: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 1

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

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

⋆ ⋆ ⋆ ⋆ ⋆

2 of 2

Page 11: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 2

III B.Tech I Semester Regular Examinations, November 2007PRINCIPLES OF PROGRAMMING LANGAUGES

(Computer Science & Engineering)Time: 3 hours Max Marks: 80

Answer any FIVE QuestionsAll Questions carry equal marks

⋆ ⋆ ⋆ ⋆ ⋆

1. (a) What do you mean by a general purpose language. Is C a general purposelanguage?

(b) Explain about von Neumann computer architecture.

(c) What are the three general methods of implementing a programming lan-guage? [4+4+8]

2. (a) Define syntax and semantics.

(b) The levels of acceptance of any language depend on the language description.Comment on this.

(c) Define grammars, derivation and a parse tree. [4+6+6]

3. (a) What is the problem with case sensitive names?

(b) Write short notes on floating-point data type. What do you mean by precisionand range? Also give IEEE Floating-Point Standard 754 format for single-and-double-precision representation.

(c) What is a variable? What are the attributes of a variable? Elaborate on eachof them. [4+6+6]

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)=, /=, <, <=, >=, >

andLowest or, xor

Associativity : left to right

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)

1 of 2

Page 12: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 2

(c) Explain in detail multiple selection constructs. [4+4+8]

5. (a) Explain how subprogram names are passed as parameters. Illustrate withexamples.

(b) Explain how subprogram is overloaded? Give examples. [8+8]

6. Explain the following terms :

(a) Message passing

(b) Concurrency in Ada

(c) Monitors [6+5+5]

7. (a) Discuss Terms and Goal statements in Prolog.

(b) Explain prolog interfacing process. [8+8]

8. Explain the Basic primitives of LISP. Give suitable examples. [16]

⋆ ⋆ ⋆ ⋆ ⋆

2 of 2

Page 13: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 3

III B.Tech I Semester Regular Examinations, November 2007PRINCIPLES OF PROGRAMMING LANGAUGES

(Computer Science & Engineering)Time: 3 hours Max Marks: 80

Answer any FIVE QuestionsAll Questions carry equal marks

⋆ ⋆ ⋆ ⋆ ⋆

1. Explain language evaluation criteria and the characteristics that affect them. [16]

2. Define attribute grammars. Give an attribute grammar for simple assignment state-ments. How is the order of evaluation of attributes determined for the trees of yourattribute grammar? [16]

3. (a) What are the advantages and disadvantages of implicit declaration?

(b) Evaluate the two approaches for supporting dynamic allocation and dealloca-tion for dynamic length strings.

(c) Explain in detail arrays, indices, subscript bindings, and array categories.[4+4+8]

4. (a) Explain Dijkstra’s selection construction and loop structure.

(b) Explain with examples user-located loop control mechanisms provided by var-ious languages. [8+8]

5. (a) Explain the scope and lifetime of variables use examples to demonstrate whenthey would coincide and when they don’t?

(b) What is the difference between the way original C and C89 deal with anactual parameter whose type is not identical to that of the correspondingformal parameter? [8+8]

6. (a) Briefly Explain the Sub-program level concurrency.

(b) Define monitor? Explain how cooperation synchronization and competitionsynchronization are implemented using monitors. [8+8]

7. (a) What are different exception conditions possible in Ada give their respectivemeanings?

(b) Explain how data abstraction is implemented in ADA. [8+8]

8. (a) Explain some of the important functions of LISP.

(b) Explain about LISP interpreter. [10+6]

⋆ ⋆ ⋆ ⋆ ⋆

1 of 1

Page 14: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

Code No: R05310505 Set No. 4

III B.Tech I Semester Regular Examinations, November 2007PRINCIPLES OF PROGRAMMING LANGAUGES

(Computer Science & Engineering)Time: 3 hours Max Marks: 80

Answer any FIVE QuestionsAll Questions carry equal marks

⋆ ⋆ ⋆ ⋆ ⋆

1. Explain language evaluation criteria and the characteristics that affect them. [16]

2. (a) Distinguish between two mathematical models of a language description.

(b) What do you mean by static semantic rules? Give examples of programminglanguage structures or elements that can be described easily with attributegrammars than with BNF.

(c) Describe the basic concept of denotational semantics. [5+5+6]

3. (a) What are dangling pointers and lost heap-dynamic variables? How are theycreated?

(b) What are the problems posed by managing a heap of single-size cell andvariable-size cell? Explain in detail various methods for reclaiming garbage.

[6+10]

4. (a) Explain in detail counter-controlled loops.

(b) Discuss precedence and associativity rules of different programming languages.[8+8]

5. (a) Explain with examples pass- by- value and pass- by- reference parameter pass-ing techniques.

(b) Explain type checking technique in parameter passing. [8+8]

6. Explain the following terms :

(a) Message passing

(b) Concurrency in Ada

(c) Monitors [6+5+5]

7. (a) What does it mean for an exception to be bound to an exception handler?

(b) Discuss about exception handling in ADA?

(c) How can an exception be explicitly raised in ADA? [4+8+4]

8. Explain various operations that can be performed on atoms and lists in LISP. Giveexamples. [16]

⋆ ⋆ ⋆ ⋆ ⋆

1 of 1

Page 15: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

FIRSTRANKER

R09 SET No - 1CODE NO: R09221201

II B.TECH - II SEMESTER EXAMINATIONS, APRIL/MAY, 2011PRINCIPLES OF PROGRAMMING LANGUAGES

(INFORMATION TECHNOLOGY) Time: 3hours Max. Marks: 75

Answer any FIVE questions All Questions Carry Equal Marks

- - -

1. How can knowledge of programming language characteristics benefits the wholecomputing Community? [15]

2.a) The two mathematical models of language description are generation and recognition.Describe how each can define the syntax of a programming language?

b) Develop an unambiguous grammar that describes the if statement. [8+7]

3.a) Explain all of the difference between subtypes and derived types. b) Define union, free union and discriminated union? [8+7]

4.a) How does operand evaluation order interact with functional side effect ? b) How does operand evaluation order interact with function side effects? [8+7]

5.a) Define Shallow and Deep binding for referencing environment of subprograms that Have been passed as parameters.

b) Write about Co routines. [8+7]

6.a) In what different places can the definition of a C++ member function appears? b) What is a C++ namespace and what is its purpose? [8+7]

7. Explain the following with examples a) Exception Handler b) Disabling an exception c) Continuation

d) Built-in Exception. [15]

8.a) What are the difference between CONS, LIST and APPENED? b) Write a LISP function Fib(n) that computes nth Fibonacci number. [7+8]

********

www.firstranker.com

www.firstranker.com

Page 16: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

FIRSTRANKER

R09 SET No - 2CODE NO: R09221201

II B.TECH - II SEMESTER EXAMINATIONS, APRIL/MAY, 2011PRINCIPLES OF PROGRAMMING LANGUAGES

(INFORMATION TECHNOLOGY) Time: 3hours Max. Marks: 75

Answer any FIVE questions All Questions Carry Equal Marks

- - -

1. What are some features of specific programming languages you know whose rationalesare a mystery to you? [15]

2. Write a BNF description of the Boolean expressions of Java, including the three operators&&, || and ! and the relational expressions? [15]

3.a) What are the design issues for character string types? b) What array initialization feature is available in Ada that is not available in other common

imperative languages? [7+8]

4. Write text program in c++, java and c# to determine the scope of a variable declared in afor statement. Specifically the code must determine whether such variable is visible afterthe body of the for statement. [15]

5.a) What are the different models of parameter passing methods? How are they implemented? Give example for each.

b) What causes a C++ template function to be instantiated? [8+7]

6. Write an analysis of the similarities of and differences between java packages and C++ namespaces? [15]

7. What run-time errors or conditions, if any, an Pascal programs detect and handle? [15]

8. What scoping rule is used in a) COMMON LISP

b) ML c) Haskell. [15]

* * * * * *

www.firstranker.com

www.firstranker.com

Page 17: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

FIRSTRANKER

R09 SET No - 3CODE NO: R09221201

II B.TECH - II SEMESTER EXAMINATIONS, APRIL/MAY, 2011PRINCIPLES OF PROGRAMMING LANGUAGES

(INFORMATION TECHNOLOGY) Time: 3hours Max. Marks: 75

Answer any FIVE questions All Questions Carry Equal Marks

- - - 1. Many languages distinguish between UPPER CASE and LOWER CASE letters in user-

defined names. What are the pros and cons of this design decision? [15]

2.a) Describe the basic concept of denotational semantics? b) What is the difference between synthesized and inherited attributes? [7+8]

3. What are all of the differences between the enumeration types of C++ and those of java?How does a decimal value waste memory space? [15]

4. Determine whether the narrowing explicit type conversions in two languages you knowprovide errors messages when a converted value loses its usefulness? [15]

5. What are the modes, the conceptual models of transfer, the advantages and disadvantagesof pass – by – value, pass – by – result, pass – by – value - result and pass – by -reference parameter- passing methods? [15]

6.a) What are the language design issues for abstract data types? b) What are the disadvantages of designing an abstract data type to be a pointer? [7+8]

7. Write detailed compassion of the Exception Handling capabilities of C++ and those ofJAVA? [15]

8. Define functional form and referential transparency? What data types were parts of theoriginal LISP? [15]

********

www.firstranker.com

www.firstranker.com

Page 18: Code No: R22056 R10 SET - 1 II B. Tech II Semester Regular Examinations, August -2014 · PDF file · 2016-05-01II B. Tech II Semester Regular Examinations, August -2014 ... With respect

FIRSTRANKER

R09 SET No - 4CODE NO: R09221201

II B.TECH - II SEMESTER EXAMINATIONS, APRIL/MAY, 2011PRINCIPLES OF PROGRAMMING LANGUAGES

(INFORMATION TECHNOLOGY) Time: 3hours Max. Marks: 75

Answer any FIVE questions All Questions Carry Equal Marks

- - -

1. Which produces faster Program execution, a Compiler (or) pure interpreter? What roledoes the symbol table play in a compiler? [15]

2.a) Describe the approach of using axiomatic semantics to convert the correctness of a givenprogram?

b) Convert the following EBNF to BNF S->A{bA} A-> a[b]A [7+8]

3. What is the purpose of the ACTION, GOTO table of an LR parser? Explain WithExample? [15]

4. Write text program in c++, java and c# to determine the scope of a variable declared in afor statement. Specifically the code must determine whether such variable is visible afterthe body of the for statement. [15]

5. Define static, fixed stack-dynamic, fixed heap-dynamic and heap-dynamic array. Whatare the advantages of each? [15]

6.a) What is the primary problem with using semaphores to provide synchronization? b) Explain the difference between physical and logical concurrency? [8+7]

7. What is root class of all java exception classes? What is pattern class of most java userdefined exception classes? [15]

8.a) Write a detail note on functions in ML. b) Give comparison of Functional and Imperative Languages. [7+8]

********

www.firstranker.com

www.firstranker.com