Principles of Programming Languages-Engineering-Pune University-November2017
S.E. (Computer Engg.) (Second Semester)
PRINCIPLES OF PROGRAMMING LANGUAGES
Time: Two Hours Maximum Marks : 50
N.B.:— (i) All questions are compulsory.
(ii) Figures to the right indicate full marks.
1. (a) List the Programming paradigms. For any three state which programming languages are based on them and how? 
(a) What are the benefits of implementing built-in data types in programming languages ? State the built-in data types implemented by C++. 
2. (a) What is the interpretation and translation process ? With neat diagram state the purpose of each activity in language processing with interpretation and translation. 
(b) What are abstract data types? How C++ implements abstract data types? Give example. 
3. (a) What are generic data structures and generic algorithms ? How C++ implements this generic programming constructs ? Give an example of each. 
(b) Justify the meaning of each characteristic of Java in the statement “Java is simple, architecture-neutral, portable,
interpreted and robust and secured programming language”. 
4. (a) What are the challenges for Programming in Large ? How these are addressed by programming languages? 
(b) Write a program in Java to perform the addition of two matrices (multidimensional arrays) and set the diagonal elements of the resultant matrix to 0. 
5. (a) Explain the concept of dynamic dispatch while the overriding method in inheritance. Give examples and advantages of doing so. 
(b) Write a program in Java which defines Class CONVERSION which converts one unit of length into another using multiplying factor. This class has data members unit_in, unit_out, and multiplier. When user creates the object, the constructor accepts the value of the multiplier and sets this for further conversion of units. The object uses methods to get value of unit_in and output value of unit_out and stores these in class variables. 
6. (a) State two major differences in class and an interface. “Interface gives multiple inheritance facility just as in C++”
(b) State the use of the following constructs in Java with an example : 
(1) final method declaration in superclass while inheritance
(2) abstract class declaration
(3) method overriding.
7. (a) Define the term exception. State the advantage of exception handling. What are the types of exceptions? 
(b) State the use of the following methods for programming applet. Give example of using each of these, init( ), start( ), paint( ), stop( ), destroy( ), update( ). 
8. (a) What is the difference between byte streams and character streams? Demonstrate the use of console class to get inputs and show results. 
(b) Write a program in Java to calculate the value of ((x + y)/(x – y)). Program should prevent the condition x – y = 0.