Wednesday, September 21, 2011

Question Bank of OOPs



Q.1          Object is Variable of
                (a) Inheriance        (b) Polymorphism (c) Class                (d) Data Hiding
Q.2          We can derive a new Classs from Base Class by using
                (a) Polymorphism (b) Inheriance       (c) Data Hiding     (d) Class
Q.3          Function Overloading is part of
                (a) Inheriance        (b) Polymorphism (c) Class                (d) Data Hiding
Q.4          << is called
                (a) Insertion Operator          (b) Extraction Operator        (c) Object               (d) Header File
Q.5          >> is called
                (a) Insertion Operator          (b) Extraction Operator        (c) Object               (d) Header File
Q.6          Out of which one is not the keyword in C++
                (a) array                 (b) if        (c) else   (d) data
Q.7          We pass array to a function as a
                (a) Pass by Value                 (b) Pass by Reference        
(c) Pas by Constant             (d) array can not pass to a function
Q.8          The parameter which are written within the function header are
                (a) Actual parameter            (b) Formal Parameter            (c) Static Parameter     (d) Global Parameter
Q.9          The binding of data and function together into a single unit class is called
                (a) Inheriance        (b) Encapsulation                 (c) Overloading    (d) Data Hiding
Q.10        The access specifier tells about
                (a) Visibility of member       (b) Polymorphism (c) Class                (d) Object
Q.11        Object is
                (a) Instance of  Class           (b) Instance of  Int               (c) Class                (d) Not available in oop
Q.12        Which is not an access specifier?
                (a) Private              (b) Public               (c) Protected         (d) Void
Q.13        Constructor is a
                (a) Member Function           (b) Member Data                  (c) Class                (d) Object
Q.14        Constructor can be used for
                (a) Automatic initialization (b) Creating Objects            (c) Data Hiding     (d) Creating Class
Q.15        Copy Constructor are used
                (a) to copy one object to another      (b) to verify objects            
(c) to change data member                 (d) to change the name of member function 
                                                                 
Q.16        Find errors, if any, in the following C++ statements: 
16.1           cout<<”x=”x;
16.2           int mul (int a,b);
16.3           float average (x,y);
16.4           long float x;

Q.17         Convert the following expression into C++ statements:                                                                  

17.1           xy + zy/x
17.2           XYZ2 + Y2Z3 
Q.18         Calculate the following expression if x=5, y=4, z=3                                                                                    
18.1           x + y * z +y/x *z
18.2           x/y + z * 2
18.3           (x + y) * z + y/(x *z)
18.4           ! (x<y)
18.5           ! (x<y) && (y >z)

Q.1          What is Expression?
Q.2          What is the difference between = and === operator?
Q.3          What is the difference between C++ Class and C++ Structure?
Q.4          What are the important characteristics of OOP?
Q.5          What is Scope Resolution Operator?
Q.6          What is the difference between class and Object?
Q.7          What is class? How object of a class are created?
Q.8          What is Constructor?
Q.9          What is Destructor?
Q.10        What is Copy Constructor?
Q.11        How does a main () function in C++ differ from main() in C?
Q.12        What is a reference variable? What is its major use?
Q.13        What do you mean by dynamic initialization of a variable? Give an example.
Q.14        How does an Inline function differ from a preprocessor macro?
Q.15        When will you make a function Inline? Why?
Q.16        What is a parameterized constructor?
Q.17        What is constructor overloading?
Q.18        What is Constructor? Explain with an example various types of constructors.      
Q.19        What is Inline function? Explain with an example.                                                       
Q.20        Write a program in C++ which generates series of prime numbers using constructor
Q.21        Distinguish between the following terms:
                (a)           Object and Class
                (b)           Data abstraction and Data encapsulation
                (c)           Inheritance and polymorphism
                (d)           Dynamic binding and Message Passing
Q.22        write a function using reference variables as arguments to swap the values of a pair of integers.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.