User talk:Hacker avijitism

DEPARTMENT OF CSE/IT INTERNAL II                                                       SUB:OOPS                                F.M-30 SEM:3rd                                TIME-1 Hour Answer all from section-A and any two from section-B

SECTION-A    (5*2)

1. What is a destructor? Why it cannot be overloaded? 2. How can we differentiate between a pre and post increment operator while overloading? 3. State any four properties of a constructor. 4. Write a small program to show copy constructor. 5. State the following statement is true or false with proper reason. “Data members of a class can not be initialized at the point of declaration.”

SECTION-B   (2*10)

1. What is the rule for overloading unary and binary operator through member function and friend function? Write a program to perform subtraction between two complex numbers using the concept of operator overloading. (2+8)

2. What is a friend function? Does it violate the rule of encapsulation and data hiding? Write a program to explain the friendship between two classes, where the private data of one class is accessed through public member function of another class. (2+2+6)

3.Attempt the following two programs. (5+5) (a)	Using friend function, W.A.P. to overload unary minus operator.

(b) Create a class called triangle that stores the length of the base and height of a right-angled triangle in two private instance variables. Include a parameterized constructor that sets these values. Define two functions. The first one is hypot, that returns the length of the hypotenuse and the second is area, which returns the area of the triangle. W.A.P. to accomplish it.