JNTU
JNTU B.Tech II PRINCIPLES OF PROGRAMMING LANGUAGES Previous Question Paper (August/September - 2022 - R15)
Answer any five questions. All questions carry equal marks.
Main
Give the syntax of ‘case’ statement in pascal using BNF notation and syntax graphs.
Answer
In BNF notation, the case statement is defined as:
<case-list> ::= <case-element> | <case-list> ; <case-element>
<case-element> ::= <constant-list> : <statement> | <empty>
<constant-list> ::= <constant> | <constant-list> , <constant>
A syntax graph for the case statement is represented as a directed graph where:
- The entry point starts with the keyword 'case'.
- A path leads to an expression, followed by the keyword 'of'.
- The path then enters a loop for the case-list, where one or more constant lists are followed by a colon and a statement, separated by semicolons.
- The path terminates at the keyword 'end'.
Discuss the relative advantages of object oriented programming paradigm.
Answer
The object-oriented programming (OOP) paradigm offers several significant advantages for software development:
- Modularity and Encapsulation: OOP allows data and methods to be bundled into objects, hiding internal implementation details. This reduces complexity and prevents unintended interference between different parts of the system.
- Reusability through Inheritance: New classes can derive properties and behaviors from existing classes, promoting code reuse and reducing redundancy.
- Maintainability: Because code is organized into discrete, self-contained objects, debugging and updating specific features is easier without affecting the entire codebase.
- Polymorphism: This feature allows objects of different types to be treated as instances of a common superclass, enabling flexible and extensible code that can handle new data types without major modifications.
- Scalability: The structure of OOP makes it easier to manage large, complex software systems by breaking them down into manageable, interacting objects.
Write the basic concept of denotational semantics.
Answer
Sign in to view the complete answer paper.
Explain the various programming domains and their associated languages.
Answer
Sign in to view the complete answer paper.
Why type checking is used? Compare static and dynamic type checking and give their relative advantages.
Answer
Sign in to view the complete answer paper.
How are different iterative statements represented? Explain with examples.
Answer
Sign in to view the complete answer paper.
Define an array. Explain the process of array initialization. Discuss the types of arrays available with examples.
Answer
Sign in to view the complete answer paper.
Why unconditional branching is used? Explain the problems associated with it.
Answer
Sign in to view the complete answer paper.
How is subprogram overloaded? Give examples.
Answer
Sign in to view the complete answer paper.
Write about scope and lifetime of variables with examples.
Answer
Sign in to view the complete answer paper.
Name the languages which allows co-routines. What are the characteristics of co-routines?
Answer
Sign in to view the complete answer paper.
Briefly explain parameter passing methods with examples.
Answer
Sign in to view the complete answer paper.
Discuss the importance of exception handling in ADA. Explain.
Answer
Sign in to view the complete answer paper.
Explain about c# threads.
Answer
Sign in to view the complete answer paper.
Give about the operations that can be performed on atoms and lists in LISP.
Answer
Sign in to view the complete answer paper.
Write about the different types of type variables, Supported in python?
Answer
Sign in to view the complete answer paper.