The document is a past final exam for a Concepts of Programming Language course. It contains 3 questions assessing various programming concepts:
1. Question 1 covers coercion, short-circuit evaluation, design of loop statements, and evaluating order of operands in C programs.
2. Question 2 covers arguments for and against user-defined operator overloading, why destructors are used in C++ but not Java, and design issues of nested classes.
3. Question 3 asks about sleep, join, and yield methods in Java, difference between checked and unchecked exceptions, and writing a Scheme function to calculate power of two numbers.
The document is a past final exam for a Concepts of Programming Language course. It contains 3 questions assessing various programming concepts:
1. Question 1 covers coercion, short-circuit evaluation, design of loop statements, and evaluating order of operands in C programs.
2. Question 2 covers arguments for and against user-defined operator overloading, why destructors are used in C++ but not Java, and design issues of nested classes.
3. Question 3 asks about sleep, join, and yield methods in Java, difference between checked and unchecked exceptions, and writing a Scheme function to calculate power of two numbers.
The document is a past final exam for a Concepts of Programming Language course. It contains 3 questions assessing various programming concepts:
1. Question 1 covers coercion, short-circuit evaluation, design of loop statements, and evaluating order of operands in C programs.
2. Question 2 covers arguments for and against user-defined operator overloading, why destructors are used in C++ but not Java, and design issues of nested classes.
3. Question 3 asks about sleep, join, and yield methods in Java, difference between checked and unchecked exceptions, and writing a Scheme function to calculate power of two numbers.
Fall 2021 Final Exam CSE 425 (Concepts of Programming Language) Section 3 Total Marks: 30 Time: 1 hour
1. a) Explain coercion and short-circuit evaluation with example. 3
b) What are the design issues for logically controlled loop 3 statements? What is the difference between the for statement of C++ and that of Java? c) Consider the following C program: 4
int fun(int *i) { void main() {
*i += 7; int x = 5; return *i; x = x + fun(&x); } }
What is the value of x after the assignment statement in main,
assuming a. operands are evaluated left to right. b. operands are evaluated right to left.
2. a) What are arguments for and against a user program building 4
additional definitions for existing operators, as can be done in Python and C++? Do you think such user-defined operator overloading is good or bad? Support your answer. b) Why are destructors rarely used in Java but essential in C++? 3 c) What are the design issues of nested class? Name few languages 3 that support it.
3. a) What does sleep, join, and yield method do in java? 3
b) Differentiate between checked and unchecked exception in Java. 3 c) Write a Scheme function that takes two numeric parameters, A 4 and B, and returns A raised to the B power.