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 4 Total Marks: 30 Time: 1 hour

1. a) Define operator precedence and operator associativity. What are the 3


advantages of referential transparency?
b) Explain how C#’s switch statement is safer than that of C. 3
c) Consider the following program written in C syntax: 4
void void main() {
swap(int int value = 0, list[5] = {1, 2,
a, int b) 3, 4, 5};
{ swap(value, list[1]);
int temp; swap(list[0], list[1]);
temp = a; swap(value, list[value]);
a = b; }
b = temp;
}

For each of the following parameter-passing methods, what are all of


the values of the variables value and list after each of the three calls to
swap?
a. Passed by value
b. Passed by reference
c. Passed by value-result

2. a) What are the differences between a function and a procedure? 3


b) What are the differences between a C++ abstract class and a Java 3
interface?
c) Make a comparison of the exception-handling capabilities of C++ and 4
those of Java.

3. a) What do you understand with ‘Naming Encapsulation’? Which 3


languages support it?
b) Why should you consider support concurrency features when you 3
design a programming language?
c) Write a Scheme function that returns the reverse of its simple list 4
parameter.

You might also like