Assessment
Assessment
Q1) Explain in brief the concept of the following (Give suitable examples of each)
I. constructor
II. destructor
III. function overloading
IV. operator overloading (2)
Q2) Define a preprocessor macro INPUT(t,x) that will enter the elements of array of data type t with size
x ? (3)
Q3)
class A
{ int a1,a2,a3;
public( ): i. Tell the type of inheritance used in the code
A( );
void getA();
ii. Write names of all the data members which are
void displayA();
}; accessible from
class B : public A the objects of class C?
{ the objects of class A?
protected: the objects of class B?
int b1,b2;
public:
iii. Write names of all the members accessible
int b3;
B( ); from member functions of class A?
void getB(); from member functions of class B?
void displayB(); from member functions of class C?
};
class C : public B
iv. Write names of all the member functions which are
{ int c1,c2,c3;
public: accessible
C( );
void getC(); from objects of class A?
void displayC(); from objects of class B?
}; from objects of class C?
(5)