JNTU

JNTU B.Tech II PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (September/October - 2023 - R13)

B.Tech | II | II | R13 | September/October - 2023

Answer PaperPaper Code: 114DJMaximum 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)

125 marks
a
Give an attribute grammar for simple assignment statements.
2 marks

Answer

An attribute grammar for simple assignment statements can be defined as follows:

Non-terminals:

assign (assignment statement)

expr (expression)

Terminals:

id (identifier), := (assignment operator), +, -, *, / (arithmetic operators), (, ) (parentheses)

Attribute:

synthesized attribute: val (the value of the expression)

Production Rules:

assign -> id := expr

expr -> expr + expr

expr -> expr - expr

expr -> expr * expr

expr -> expr / expr

expr -> ( expr )

expr -> id

The attribute grammar would associate semantic rules with these productions to compute the value of the expression.

b
Explain about the Virtual Machine.
3 marks

Answer

A Virtual Machine (VM) is a software-based emulation of a computer system. It mimics the hardware of a physical computer, allowing multiple operating systems and applications to run on a single physical machine as if they were on separate, independent computers.

Key aspects of a Virtual Machine:

  • Abstraction: VMs provide an abstraction layer over the physical hardware, isolating the guest operating system and applications from the underlying hardware.
  • Isolation: Each VM operates in its own isolated environment, preventing issues in one VM from affecting others or the host system.
  • Portability: VM images can be easily moved and run on different physical hardware, provided the virtualization software is compatible.
  • Resource Management: Virtualization software (hypervisor) manages and allocates physical resources (CPU, memory, storage, network) to the VMs.
  • Execution Environment: VMs execute instructions in a controlled environment, often translating them for the host CPU or running them on a simulated CPU.

In programming languages, VMs are crucial for platform independence (e.g., Java Virtual Machine - JVM) and for executing intermediate code like bytecode.

c
Explain about guarded commands.
2 marks

Answer

Sign in to view the complete answer paper.

d
Compare record and union.
3 marks

Answer

Sign in to view the complete answer paper.

e
Differentiate between actual and formal parameters.
2 marks

Answer

Sign in to view the complete answer paper.

f
Give a brief note on Scope and lifetime of variable.
3 marks

Answer

Sign in to view the complete answer paper.

g
List the applications of Logic programming.
2 marks

Answer

Sign in to view the complete answer paper.

h
Explain the basic elements of prolog.
3 marks

Answer

Sign in to view the complete answer paper.

i
How Haskell is different from ML?
2 marks

Answer

Sign in to view the complete answer paper.

j
Describe the scoping rule in ML.
3 marks

Answer

Sign in to view the complete answer paper.

Unit I

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 about the preconditions and postconditions of a given statement mean in axiomatic semantics.
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
Describe the steps involved in the language evaluation criteria.
5 marks

Answer

Sign in to view the complete answer paper.

Unit II

410 marks
a
Explain about the type compatibility with an example.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain about the control structures with an example.
5 marks

Answer

Sign in to view the complete answer paper.

OR
510 marks
a
What do you mean by binding and binding time? Describe about various classes of binding times.
5 marks

Answer

Sign in to view the complete answer paper.

b
Describe about the pointers in FORTRAN 90, Ada, and pascal with an example.
5 marks

Answer

Sign in to view the complete answer paper.

Unit III

610 marks
a
Explain about the generic subprograms in Ada with an example.
5 marks

Answer

Sign in to view the complete answer paper.

b
What are the characteristics of co-routine? List the languages which allow co-routines.
5 marks

Answer

Sign in to view the complete answer paper.

OR
710 marks
a
Explain about the overloaded operators in C++.
5 marks

Answer

Sign in to view the complete answer paper.

b
What are the general subprogram characteristics? Explain.
5 marks

Answer

Sign in to view the complete answer paper.

Unit IV

810 marks
a
Elaborate how message passing helps in concurrency control? Explain with an example.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain how to handle the exceptions in C++.
5 marks

Answer

Sign in to view the complete answer paper.

OR
910 marks
a
Explain about the data abstraction for SIMULA 67.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain about exception handling in Java.
5 marks

Answer

Sign in to view the complete answer paper.

Unit V

1010 marks
a
List and discuss in detail about data types in python with examples.
5 marks

Answer

Sign in to view the complete answer paper.

b
Explain about the internal representation of two LISP lists.
5 marks

Answer

Sign in to view the complete answer paper.

OR
1110 marks
a
Describe the scoping rule in common LISP and Haskell.
5 marks

Answer

Sign in to view the complete answer paper.

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

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of PRINCIPLES OF PROGRAMMING LANGUAGES from JNTU for B.Tech IT II II, September/October - 2023, R13.

For the question paper without answers, switch to the Question Paper tab.

Other papers in PRINCIPLES OF PROGRAMMING LANGUAGES

Loading Question Papers

Fetching data from database...