Code: CS23                                                  Subject: OBJECT ORIENTED PROGRAMMING

Flowchart: Alternate Process: SEPTEMBER 2010                                                                                                                                      USING C++

Time: 3 Hours                                                                                                     Max. Marks: 100



·      Question 1 is compulsory and carries 28 marks. Answer any FOUR questions from the rest.  Marks are indicated against each question.

·      Parts of a question should be answered at the same place.



Q.1       a.  Compare the concepts of structures in ‘C’ & classes in ‘C++’ with the help of suitable examples.


             b.  Differentiate between static polymorphism and run-time polymorphism.


             c.  Compare ‘inline function’ in C++ with macros of C language.


             d.  Can constructors and destructors be overloaded?  Comment.


             e.  State why Operator Overloading is required.  Mention the operators in C++ that cannot be overloaded?


             f.   Discuss the uses of friend function in C++.


             g. Give the general syntax of function templates and explain their use.                            (74)


Q.2       a.  Discuss and compare procedure oriented programming with object oriented programming.


             b.  Write a C++ code to demonstrate the concept of using array of objects to create an array of ten employees (reading their entire personal data: Name, age, emp_ID, sex, address) and print the same. (9+9)


  Q.3     a.  Explain Multiple Inheritance, Multilevel inheritance, Hierarchical Inheritance & Hybrid Inheritance illustratively and with the help of C++ code.                                                                                         


             b.  Explain parameterised constructors with the help of suitable examples.                     (12+6)


  Q.4     a.  Compare and contrast the following with suitable examples:

                  (i)   cin and cout in C++.

                  (ii)  copy constructor and assignment operator.


             b.  Write a C++ program to read two strings S1 and S2 and perform the task S3 = S1 + S2 and print the string S3.  Consider overloading of the ‘+’ operator using friend functions in C++.                   (8+10)


  Q.5     a.  Explain the behaviour of constructors in Multiple Inheritance.                                             


             b.  Write a function NewStrCmp that does the same job as strcmp without using string library function (use pointers)                                                                                                                           


             c.  Differentiate between a virtual function and a pure virtual function.  Discuss the role of pure virtual function.                                                                                                                              (6+6+6)


  Q.6     a.  Differentiate between Abstraction and Encapsulation with the help of example.                   


             b.  Explain with the help of an example virtual base class.  What is its role in C++?


             c.  How does overloading a suffix and prefix document operator differ.  Explain it with the help of an example.                                                                                                                            (6+6+6)


  Q.7          Write short notes on (Any THREE)


                  (i)    Exception Handling.

                  (ii)   Template class.

                  (iii)  File handling.

                  (iv)  Friend class.                                                                                                 (6+6+6)