Thursday 28 April 2011

question paper review(april 2011)

Question paper review:
hi I believe all of you wrote good for cpp exam. Here I analyze which appears to be confusion for you

  1. What is the Principle of OOP?
  2.  Ans:
    It is nothing but Properties of OOP's. If u write at least 4 properties also you get full marks
    1. Define Constructor. Write is syntax.
     Ans: 
    1. Compare classes in C++ with structures in C.
     Ans: means difference between classes and structures
    1. Define Pass by reference method
     Ans:here you have to write the definition of REFERENCE Variable
    (actually there are two kinds of Function calls (1)Pass by Value (2) Pass by Reference. Do u remember I explained swap the values using pass by reference while explaining the Reference variable.)
    1. List the uses of references.
      Ans: /*see the notes for advantages of reference variable. This question is most frequently asked question in Interviews > 
    1) Fast Execution 2) Saving Memory 3) We can avoid the pointers 4) dulication is avoided
    5) No complexity
    1. State the relationship between base class and derived class.
    Ans: 
    1. State any three Benefits of Inheritance.
     Ans: here you have to write the advantages of Inheritance
    1. State the need for Virtual Functions in C++.
    Ans:/* if you write the definition of virtual function it is enough    */ (i) main reason for having a virtual function is to implement a different functionality in the derived class. (ii) to add (means we can redefine in derived class) more facility to that function (iii)virtual functions are needed to develop late binding concepts.  9.     Define custom / user defined manipulators.
    Ans: Actually this question is unexpected question.
             There are two kinds of manipulators 
             (1) standard I/O manipulators
             (2)User defined(custom) manipulators
             if you write the standard I/O manipulators also they may give you the marks
            An important feature of c++ streams is that they also work well with user-defined manipulators as they do with predefined(build-in) manipulators. Hence, the users can design their own(customized) manipulators to control the appearance of the output depending upon their taste and need. The syntax for crating a custom manipulators is shown as follows. In the syntax, manipulator is the name of the user defined manipulator. Output is the manipulator caller and stream cascading object and arguments if any is used for arguments for parameterized manipulator. Syntax: Ostream& manipulator(ostream &output, argements) {        -------       -------      -------    return statement; }
             /*to see the answer then go to 4th chapter C++ I/O 
    10. What is Generic programming?
    Ans: Generic Programming is nothing but Templates. I hope you wrote this question
    PART- B                                    5*10=50
    1. How will you overload Unary and binary operator using Friend functions?
    Ans:  we know that there are two types of operator overloading:          (i) unary operator overloading          (ii)binary operator overloading
    1. (a)Explain the structure of C++ program with an example program.   
    Ans:
            (b) Explain the steps in developing a C++ program.
    Ans:
    1. Write a C++ program function overloading.
    Ans:
    1. Explain the creating and accessing of array of objects with an example program.
    Ans:
    1. Write a C++ program to illustrate multiple inheritance.
    Ans:
    1. Write a C+ program to illustrate virtual base class in multipath inheritance.
    Ans:
    1. Explain the various file stream classes needed for File Manipulators.
    Ans:  (i) Ofstream: stream class to write on files  (ii)Ifstream: stream class to read from files  (iii)Fstream: stream class to both read and write from/to files. these  classes are derived directly or indirectly from the classes istream, and ostream. We have already used objects whose types were these classes: cin is an object of class istream and cout is an object of class ostream. Therefore, we have already been using classes that are related to out file streams. Ans in fact, we can use our file streams the same way we are already used to usecin and cout, with the only difference that we have to associate these streams with physical files: (i) ifstream: this is the class for input operation on files similarly to statndard input. It includes the methods(functions) open(), close(), read(), get() getline(), and the overloaded extraction operator. (ii) ofstream: this is the class for output operation of files. Similarly, to standard output methods included are open(), close(), put(), write() and the overloaded insertion oerator., (iii) fstream: this class derived from both ifstream and ofstream all the classes are declared in the fstream.h header file. The file also includes iostream.h files
    1. Explain a class template for stack data structures.
    Ans:

1 comment:

  1. hi,sir iam ranjith from cme A section,sir do you know when results will be declare .

    ReplyDelete