Q.1.
(a) Explain the concepts of encapsulation and information hiding in
an object oriented paradigm with the help of an example in C++.
(b) Explain ‘dynamic binding’, with the help of an example.
Give its advantages and disadvantage.
(c) Differentiate between function and operator overloading. Also
give one example of each.
(d) What are public and private inheritance? Why do we need different
access specifiers?
(e) Explain the utility of the friend function, using an appropriate
example.
(f) Write a String class in C++ which should include the member function
to calculate the length of the string.
Q.2.
(a) If a base class and derived class each include a member function
with the same name, which member function will be called by an object
of a derived class, and why?
(b) Write a program to read and display information about employees
and managers. Employees is a class that contains employee_no, name
and address. Manager class contains all the information of the employee
class and the list of employees working under this manager.
Q.3.
(a) Define a class template. What are its advantages?
(b) Write a temple function for exchanging (swapping) the values between
two variables. Use this function in main ( ) for int, double and char
type of variables.
Q.4.
(a) What is an interaction diagram? Explain the steps involved in
drawing each such a diagram, with the help of example.
(b) Explain the concept of virtual functions. Give three examples
of the use of such functions.