0% found this document useful (0 votes)
88 views1 page

Assessment

The document contains 3 questions about object-oriented programming concepts in C++. Question 1 asks to explain constructors, destructors, function overloading, and operator overloading with examples. Question 2 asks to define a preprocessor macro to input array elements. Question 3 asks about inheritance and accessibility in a class hierarchy with classes A, B, and C, asking to identify the inheritance type, accessible data members and member functions from different classes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views1 page

Assessment

The document contains 3 questions about object-oriented programming concepts in C++. Question 1 asks to explain constructors, destructors, function overloading, and operator overloading with examples. Question 2 asks to define a preprocessor macro to input array elements. Question 3 asks about inheritance and accessibility in a class hierarchy with classes A, B, and C, asking to identify the inheritance type, accessible data members and member functions from different classes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Thapar University, Patiala

Department of Computer Science and Engineering


B. E. (First Year)
Assignment: Computer Programming-I(UTA007 )
T. Marks: 10 marks Weightage:5 marks

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)

You might also like