ALCCS

 

 

Code: CS23                                                  Subject: OBJECT ORIENTED PROGRAMMING

Flowchart: Alternate Process: MARCH 2010                                                                                                                                      USING C++

Time: 3 Hours                                                                                                     Max. Marks: 100

 

NOTE:

·      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.  Discuss the following with the help of an example.

                  (i)   Virtual functions.

                  (ii)  Virtual Class.

 

             b.  Differentiate between a member function and static member function in C++.

                                                           

             c.  Is containership same as inheritance? Comment?

 

             d.  What are the problems in using virtual constructions in C++.

                 

             e.  Give the hierarchy of I/O stream classes in C++.

                 

             f.   How does copy constructor differs from assignment operator.

 

             g. Differentiate between early and late binding.                                                              (74)

 

Q.2       a.  Discuss the principles of Abstraction, Encapsulation, Inheritance and Polymorphism in object oriented programming with suitable examples.                                                                                 

                                   

             b.  How does object-oriented approach differ from object-based approach?                          

 

             c.  Write a brief note on Exception Handling mechanism in C++.                              (10+4+4)

 

  Q.3     a.  How polymorphism is achieved using the concept of operator overloading. Write a program to concatenate strings using operator-overloading concept.                                                                       

 

             b.  What is the basic difference between manipulators and ios member functions in terms of implementation?  Design two manipulators, currency that displays “Rs.” in front of currency value and form that print float values with following specifications:

                  10 Column width, Right-justified, Two-digit precision, Filling of unused places with * and trailing zeros shown.                                                                                                                                (9+9)            


 

  Q.4     a.  For the following problem definition, write a program in C++ that exhibits run-time polymorphism.

                  Create a class publication that stores the title, price of a publication.  From this class derive two classes book which adds a page count: and tape which adds playing time in fractions of minutes.  Each of these three classes should have getdata() and putdata() functions to get and display data from/to the user.  Write main() function to test the book and tape classes by creating instances of them asking the user to fill data with getdata(), and display data with putdata().                                                                                              

 

             b.  Write six differences between a structure and class in C++.                                    (12+6)

 

  Q.5     a.  What is a friend class.  Give an example where use of friend class/function is necessary.     

 

             b.  What are C++ storage classes?                                                                                        

                                                                                                               

             c.  Discuss three storage qualifiers in C++?                                                                (6+6+6)

 

  Q.6     a.  What is a copy constructor? Explain it with the help of a suitable example. When are copy constructors called?                                                                                                                                        

 

             b.  Differentiate between private, public and protected access modifiers.  Explain their meaning in the context of derived class inheriting from a base class using these specifiers.                                  (9+9)

 

  Q.7          Compare and contrast the following with suitable examples.

 

                  (i)   Inline function Vs Macros

                  (ii)  Multiple Vs Multilevel inheritance

                  (iii) Function overloading and Function overriding                                                  (6+6+6)