JNTU

JNTU B.Tech II PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (February - 2024 - R15)

B.Tech | II | II-II | R15 | February - 2024

Answer PaperPaper Code: 124DJMaximum Marks: 75Time: 3 Hours

Note: i) Question paper consists of Part A, Part B. ii) Part A is compulsory, which carries 25 marks. In Part A, answer all questions. iii) In Part B, Answer any one question from each unit. Each question carries 10 marks and may have a, b as sub questions.

PART - A

(25 Marks)
115 marks
a
Give an attribute grammar for simple assignment statements.
2 marks

Answer

An attribute grammar for simple assignment statements, such as x = y + 1, can be defined as follows:

Let assign be the non-terminal for an assignment statement.

Let id be a non-terminal representing an identifier.

Let expr be a non-terminal representing an expression.

The grammar rules are:

assign ::= id = expr

Attributes:

  • id.lval: boolean, true if the identifier is on the left-hand side of an assignment.
  • expr.val: the value of the expression.

Semantic rules:

  • For the rule assign ::= id = expr:
    • id.lval must be true.
    • expr.val is computed.
    • The value of expr.val is assigned to the location represented by id.
b
What are the factors influencing the writability of a language?
3 marks

Answer

The factors influencing the writability of a programming language, which refers to how easily a language can be used to construct programs, include:

  • Simplicity: A language with a smaller set of fundamental concepts and constructs is generally easier to learn and use.
  • Expressiveness: The ability to express a wide range of computations and algorithms concisely and clearly.
  • Readability: A language that is easy to read and understand often leads to better writability, as code written by one programmer can be easily understood by others.
  • Orthogonality: A set of primitive constructs that can be combined in a small number of ways to achieve all other constructs. This reduces the number of exceptions and special cases.
  • Support for Abstraction: The ability to define and use abstract data types and control structures helps in managing complexity.
  • Standardization and Tool Support: Well-defined standards and good tool support (compilers, debuggers, IDEs) improve the development experience.
c
Compare record and union.
2 marks

Answer

Sign in to view the complete answer paper.

d
What do you mean by binding? Give examples of bindings?
3 marks

Answer

Sign in to view the complete answer paper.

e
Explain about co routines.
2 marks

Answer

Sign in to view the complete answer paper.

f
Explain generic subprograms with an example.
3 marks

Answer

Sign in to view the complete answer paper.

g
Briefly describe advantage of monitor over semaphores.
2 marks

Answer

Sign in to view the complete answer paper.

h
What is the purpose of a C++ destructor?
3 marks

Answer

Sign in to view the complete answer paper.

i
Describe the scoping rule in ML.
2 marks

Answer

Sign in to view the complete answer paper.

j
How Haskell is different from ML?
3 marks

Answer

Sign in to view the complete answer paper.

PART - B

(50 Marks)
210 marks
a
What is need for study of programming languages? Explain.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain the evolution of major programming languages.
5 marks

Answer

Sign in to view the complete answer paper.

OR
310 marks
a
Describe the Programming Paradigms.
5 marks

Answer

Sign in to view the complete answer paper.

b
Construct the parse tree for the simple statement. A := B * (A + C).
5 marks

Answer

Sign in to view the complete answer paper.

410 marks
a
List and explain the design issues for all iterative control statements.
5 marks

Answer

Sign in to view the complete answer paper.

b
Define an array. Explain the different types of arrays.
5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a
Describe about various classes of binding times.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain in detail various design issues of character string types.
5 marks

Answer

Sign in to view the complete answer paper.

610 marks
a
What is the difference between the way original C and C89 deal with an actual parameter whose type is not identical to that of the corresponding formal parameter?
5 marks

Answer

Sign in to view the complete answer paper.

b
Illustrate stack based implementation of subprograms.
5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a
What are the characteristics of co-routine feature? List the languages which allow co-routines.
5 marks

Answer

Sign in to view the complete answer paper.

b
Give a detailed note on pass-by-value and pass-by-result parameter passing methods.
5 marks

Answer

Sign in to view the complete answer paper.

810 marks
a
How can exceptions explicitly raised in C++? Explain with an example.
5 marks

Answer

Sign in to view the complete answer paper.

b
What are the applications of logic programming?
5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a
Implement Producer and Consumer problem using Semaphores.
5 marks

Answer

Sign in to view the complete answer paper.

b
Illustrate concept of abstraction and encapsulation with suitable examples.
5 marks

Answer

Sign in to view the complete answer paper.

1010 marks
a
Explain about storage control and types of binding supported by Python.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain the use of conditional expression in Haskell language.
5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a
What is the difference between an ML val statement and an assignment statement in C?
5 marks

Answer

Sign in to view the complete answer paper.

b
Discuss the key concepts of scripting languages.
5 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of PRINCIPLES OF PROGRAMMING LANGUAGES from JNTU for B.Tech IT II II-II, February - 2024, R15.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in PRINCIPLES OF PROGRAMMING LANGUAGES

Loading Question Papers

Fetching data from database...