(SEM V) THEORY EXAMINATION 2019-20 PRINCIPLES OF PROGRAMMING LANGUAGES
PRINCIPLES OF PROGRAMMING LANGUAGES (RCS-503)
B.Tech (SEM-V) – AKTU
SECTION A
(Attempt all questions – 2 × 7 = 14 marks)
Q1 (a) What are advantages and disadvantages of dynamic local variables?
Dynamic local variables are allocated memory during runtime and exist only while the function is active.
Their main advantage is efficient memory utilization because memory is released after function execution. They also support recursion effectively.
However, disadvantages include higher runtime overhead due to repeated allocation and deallocation and difficulty in debugging because variable lifetime is short.
Q1 (b) Explain lambda expression.
A lambda expression is an anonymous function that does not have a name and is used to define short pieces of code. It is commonly used in functional programming languages and modern languages like Python and Java. Lambda expressions improve code readability and reduce boilerplate code.
Q1 (c) Explain about parsing.
Parsing is the process of analyzing a sequence of tokens to determine its grammatical structure according to a formal grammar. It checks whether the syntax of a program is correct and builds a parse tree used by compilers for further processing.
Q1 (d) Define pass by result.
Pass by result is a parameter passing technique where the value of the formal parameter is copied back to the actual parameter after function execution. The initial value of the parameter is not used inside the function.
Q1 (e) Write any two design issues for arithmetic expressions.
Two design issues for arithmetic expressions are operator precedence and associativity. Operator precedence determines the order of evaluation, while associativity determines how operators of the same precedence are grouped.
Q1 (f) Explain fundamentals of functional programming language.
Functional programming is based on mathematical functions and avoids changing state or mutable data. It emphasizes recursion, higher-order functions, and immutability, leading to more reliable and predictable programs.
Q1 (g) What is an overriding method?
Method overriding occurs when a subclass provides a specific implementation of a method already defined in its parent class. It supports runtime polymorphism and improves flexibility in object-oriented programming.
SECTION B
(Attempt any three – 7 × 3 = 21 marks)
Q2 (a) Explain about static, fixed stack dynamic, fixed heap dynamic and dynamic variables.
Static variables are allocated at compile time and exist throughout program execution.
Fixed stack dynamic variables are allocated during function calls and deallocated when the function ends.
Fixed heap dynamic variables are allocated from heap memory but with fixed size.
Dynamic variables have size and lifetime determined at runtime and provide maximum flexibility.
Q2 (b) Write notes on coercion expressions and short-circuit evaluation.
Coercion expressions involve implicit type conversion during expression evaluation, such as converting integers to floating-point numbers.
Short-circuit evaluation stops expression evaluation as soon as the result is known, improving efficiency and preventing unnecessary computations.
Q2 (c) Write differences between procedural and non-procedural languages.
Procedural languages focus on step-by-step instructions and use functions and procedures to structure programs.
Non-procedural languages focus on what result is required rather than how it is achieved and are commonly used in declarative programming.
SECTION C
(Attempt any one – 7 × 1 = 7 marks)
Q3 (e) What is an event? How are events handled in various OOP languages?
An event is an action or occurrence detected by a program, such as mouse clicks or key presses.
In object-oriented languages, events are handled using event listeners or handlers. Java uses event listener interfaces, C# uses delegates and events, while Python handles events using callback functions. Event-driven programming improves interactivity and responsiveness of applications.
Related Notes
BASIC ELECTRICAL ENGINEERING
ENGINEERING PHYSICS THEORY EXAMINATION 2024-25
(SEM I) ENGINEERING CHEMISTRY THEORY EXAMINATION...
THEORY EXAMINATION 2024-25 ENGINEERING MATHEMATICS...
(SEM I) THEORY EXAMINATION 2024-25 ENGINEERING CHE...
(SEM I) THEORY EXAMINATION 2024-25 ENVIRONMENT AND...
Need more notes?
Return to the notes store to keep exploring curated study material.
Back to Notes StoreLatest Blog Posts
Best Home Tutors for Class 12 Science in Dwarka, Delhi
Top Universities in Chennai for Postgraduate Courses with Complete Guide
Best Home Tuition for Competitive Exams in Dwarka, Delhi
Best Online Tutors for Maths in Noida 2026
Best Coaching Centers for UPSC in Rajender Place, Delhi 2026
How to Apply for NEET in Gurugram, Haryana for 2026
Admission Process for BTech at NIT Warangal 2026
Best Home Tutors for JEE in Maharashtra 2026
Meet Our Exceptional Teachers
Discover passionate educators who inspire, motivate, and transform learning experiences with their expertise and dedication
Explore Tutors In Your Location
Discover expert tutors in popular areas across India
Discover Elite Educational Institutes
Connect with top-tier educational institutions offering world-class learning experiences, expert faculty, and innovative teaching methodologies