P17IS36
P17IS36
1
U.S.N
Contd… 2
P17IS36 Page No... 2
UNIT - III 18
3 a. Define dynamic polymorphism and discuss how dynamic polymorphism is achieved using
9
virtual functions with an example?
b. With a C++ program, explain how we can overload the Increment and Decrement
9
operators (Prefix and Postfix)?
c. Write a C++ program to create a class called STACK using an array of integers.
Implement the following operations by overloading the operators ‘+’ and ‘- -’:
i) s1 = s1 + element; where s1 is an object of the class STACK and element is an integer
to be pushed on the top of the stack 9
ii) s1 = s1--; where s1 is an object of the class STACK, ‘- -’ operator pops the element.
Handle the STACK empty and full conditions. Also display the contents of the stack after
each operation, by overloading the << operator.
UNIT - IV 18
4 a. With a neat diagram, explain the library classes that handle streams. 9
b. What are class templates? What is the need for class templates? How are they created?
9
Create a template for bubble sort function.
c. Explain the C-Style solution for handling errors with examples. 9
UNIT - V 18
5 a. List out the features of Java and explain any three features. 9
b. List different types of iteration statements in Java and discuss the process of building and
9
running a Java application program.
c. Write a Java program to perform the subtraction of two complex numbers by using the
method sub( ) by passing object as a parameter and display the result using method
9
display( ). Initialize the real and imaginary values of the complex number using
parameterized constructor.
***