Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

North South University

Department of Electrical and Computer Engineering


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.

You might also like