oops by Vishal_Verma_0

VIEWS: 32 PAGES: 3

									                           Fourth Semester B.E Degree Examination
                                   (Common to CS and IS)
                                    Model Question Paper I

                         06CS44 Object Oriented Programming with C++
Note: Answer any FIVE Full questions, selecting at least TWO Questions from each PART

         Time: 3 Hours                                            Maximum marks : 100
                                            PART -A
   1. (a) What is the need for structures in C? Explain with suitable example.               (6)
      (b) What is object oriented programming? Compare Object Oriented with Procedure
          Oriented Programming?                                                              (6)
      (c) What is an inline function? What is the advantage of having a function inline? Write a
         C++ program to find maximum of two numbers using inline functions.                  (8)

   2. (a) Explain the use of this pointer with an example.                           (5)
      (b) What are friend classes? Explain with example.                             (5)
      (c) Write a C++ program to sort the list of students depending on their roll Numbers
                                                                                     (10)

   3. (a) Explain how new and delete operators manage memory allocation / deallocation
          dynamically?                                                                  (6)
      (b) What is a constructor? Explain different types of Constructors with examples. (7)
      (c) Write a C++ Program to generate Fibonacci series using copy constructors      (7)

   4. (a) What is inheritance? Explain different types of inheritance with examples.        (10)
      (b) Write a note on visibility of member functions based on private and protected
          derivations                                                                        (5)
      (c) Explain the order of invocation of constructors and destructors with examples.     (5)

                                             PART B
   5. (a) Explain virtual functions and write a C++ program to demonstrate dynamic
          polymorphism.                                                                     (10)
      (b) Distinguish between virtual function and pure virtual functions.                  (5)
      (c) Write a note on I/O stream classes of C++.                                        (5)

   6. (a) Write a C++ program to perform addition and multiplication of two complex
          numbers by overloading ‘+’ and ‘*’ operators                                      (10)
      (b) Explain different file pointer manipulation functions in C++.                     (10)

   7. (a) What is operator overloading? Write a C++ program to compare two data
          values representing distances in feet and inches using operator overloading       (10)
      (b) Explain new style cast operators in C++.                                          (10)

   8. (a) Write a C++ program for sorting a list of integer, floating point numbers and
          characters by bubble sort technique using template functions.                     (10)
      (b) What is exception handing and how is it treated in C++.                           (10)
                            Fourth Semester B.E Degree Examination
                                    (Common to CS and IS)
                                      Model Question Paper II

                          06CS44 Object Oriented Programming with C++
Note: Answer any FIVE Full questions, selecting at least TWO Questions from each PART

          Time: 3 Hours                                             Maximum marks : 100

                                              PART- A
1   (a)   With examples compare structures in C with classes in C++.                  (4)
    (b)   What is function overloading? What are the advantages of overloading a
          function? Write a program in C++ to overload the function add(s1,s2) where
          S1 and s2 are integers and floating point values.                          (10)
    (c)   With an example discuss the significance of function prototyping.           (6)

2   (a) what is the role played by private and public access specifiers in case
        of structures and classes? Explain with suitable examples.                    (8)
    (b) Explain with an example how one can bridge two classes using friend function. (6)
    (c) Write a note on Nested class.                                                 (6)

3. (a)    What is Dynamic Memory Management? Write a C++ program
          to create array of objects at runtime.                                        (12)
    (b)   Is overloading of constructors and destructors possible? Justify your answer? (8)

4. (a)    What is reusability? How do you achieve this in c++?                          (6)
   (b)    What are the different ambiguities involved in multiple inheritance
          and how they are resolved?                                                    (8)
    (c)   Write a C++ program to use a base class pointer to point to an
          object of derived Class without the need for type casting?                    (6)

                                            PART B

5   (a)   What are virtual functions? Explain the mechanism of virtual functions.       (8)
    (b)   With a neat diagram explain the class hierarchy for stream handling in C++.   (6)
    (c)   What is pure virtual function? Explain with an example.                       (6)

6. (a)    Distinguish between text and binary files in C++.                             (6)
   (b)    What is operator overloading? Explain its advantages. Write a C++
          program to overload ‘+’ operator to concatenate two string variables.         (10)
    (c)   What are the rules for overloading operators?                                  (4)

7. (a)    Write a C++ program to create a class ‘String’ by overloading assignment
          operator.                                                                     (8)
    (b)   Explain how to overload pointer to member operator in C++.                    (4)
    (c)   Write a note on (i) static cast operator (ii) dynamic cast operator.          (8)

8. (a)    Explain RTTI in detail.                                                       (6)
   (b)    Write a C++ program using function templates for accepting integer
          and floating values to perform stack operation.                               (8)
(c)   What is Exception handling? Explain try, throw , catch constructs in
      C++                                                                    (6)

								
To top