Wednesday, 8 February 2012

CS304 Final Term Past Solved Paper (7)


FINAL TERM EXAMINATION
Fall 2009
CS304- Object Oriented Programming (Session - 1)

Question No: 1    ( Marks: 1 )    - Please choose one
Which one of the following terms must relate to polymorphism?
       ► Static allocation
       ► Static typing
       ► Dynamic binding       (Page 239) 
       ► Dynamic allocation   
Question No: 2    ( Marks: 1 )    - Please choose one
Multiple inheritance can be of type
       ► Public
       ► Private
       ► Protected
       ► All of the given     

    
Question No: 3    ( Marks: 1 )    - Please choose one
When a subclass specifies an alternative definition for an attribute or method of its superclass, it is _______ the definition in the superclass.
       ► overload
       ► overriding     (Page 34)
       ► copy riding
       ► none of given
Question No: 4    ( Marks: 1 )    - Please choose one
Like template functions, a class template may not handle all the types successfully.
       ► True      (Page 258)  
       ► False
Question No: 5    ( Marks: 1 )    - Please choose one
It is sometimes useful to specify a class from which no objects will ever be created.
       ► True           (Object-Oriented Programming in C++)
       ► False
Question No: 6    ( Marks: 1 )    - Please choose one
Assume a class Derv that is privately derived from class Base. An object of class Derv located in main() can access 
       ► public members of Derv.     (Object-Oriented Programming in C++) rep
       ► protected members of Derv. 
       ► private members of Derv. 
       ► protected members of Base.  
Question No: 7    ( Marks: 1 )    - Please choose one
A pointer to a base class can point to objects of a derived class.
       ► True    
       ► False
Question No: 8    ( Marks: 1 )    - Please choose one
A copy constructor is invoked when 
       ► a function do not returns by value. 
       ► an argument is passed by value.       (Page 78) rep
       ► a function returns by reference. 
       ► an argument is passed by reference. 
Question No: 9    ( Marks: 1 )    - Please choose one
A function call is resolved at run-time in___________
       ► non-virtual member function.
       ► virtual member function.      (Page 239) rep
       ► Both non-virtual member and virtual member function.
       ► None of given
Question No: 10    ( Marks: 1 )    - Please choose one
When the base class and the derived class have a member function with the same name, you must be more
specific which function you want to call (using ___________).
       ► scope resolution operator
       ► dot operator
       ► null operator
       ► Operator overloading         Click here for detail  
Question No: 11    ( Marks: 1 )    - Please choose one
Each try block can have ______ no. of catch blocks.
       ► 1
       ► 2
       ► 3
       ► As many as necessary.    Click here for detail     rep
    
Question No: 12    ( Marks: 1 )    - Please choose one
Two important STL associative containers are _______ and _______.
       ► set,map       (Object-Oriented Programming in C++) rep
       ► sequence,mapping
       ► setmet,multipule
       ► sit,mat
Question No: 13    ( Marks: 1 )    - Please choose one
The mechanism of selecting function at run time according to the nature of calling object is called,
       ► late binding
       ► static binding
       ► virtual binding
       ► None of the given options   (Page 227)
    Dynamic binding means that target function for a call is selected at run time
Question No: 14    ( Marks: 1 )    - Please choose one
An abstract class is useful when
       ► We do not derive any class from it. 
       ► There are multiple paths from one derived class to another. 
       ► We do not want to instantiate its object.    (Object-Oriented Programming in C++) rep
       ► You want to defer the declaration of the class.
Question No: 15    ( Marks: 1 )    - Please choose one
Which of the following is incorrect line regarding function template?
       ► template<class T>
       ► template <typename U>
       ► Class<template T>       (Page 257) rep
       ► template  < class T, class U>
    
Question No: 16    ( Marks: 1 )    - Please choose one
Which of the following is/are advantage[s] of generic programming?
       ► Reusability
       ► Writability
       ► Maintainability
       ► All of given          (Page 256) rep
Question No: 17    ( Marks: 1 )    - Please choose one
By default the vector data items are initialized to ____
       ► 0           Click here for detail      rep
       ► 0.0
       ► 1
       ► null
Question No: 18    ( Marks: 1 )    - Please choose one
Which one of the following functions returns the total number of elements in a vector.
       ► length();
       ► size();     (Page 318)
       ► ele();
       ► veclen();
Question No: 19    ( Marks: 1 )    - Please choose one
Suppose you create an uninitialized vector as follows:
vector<int> evec;
After adding the statment,
evec.push_back(21);
what will happen?
       ► The following statement will add an element to the start (the back) of evec and will initialize it with the
value 21.
       ► The following statement will add an element to the center of evec and will reinitialize it with the value
21.
       ► The following statement will delete an element to the end (the back) of evec and will reinitialize it with
the value 21.
       ► The following statement will add an element to the end (the back) of evec and initialize it with the
value 21.                   Click here for detail
Question No: 20    ( Marks: 1 )    - Please choose one
An STL container can not be used to, 
       ► hold objects of class employee. 
       ► store elements in a way that makes them quickly accessible. 
       ► compile c++ programs.  (Object-Oriented Programming in C++) rep
       ► organize the way objects are stored in memory
Question No: 21    ( Marks: 1 )    - Please choose one
Algorithms can only be implemented using STL containers. 
       ► True
       ► False       (Object-Oriented Programming in C++)    rep
Question No: 22    ( Marks: 1 )    - Please choose one
The main function of scope resolution operator (::) is,
       ► To define an object
       ► To define a data member      
       ► To link the definition of an identifier to its declaration     Click here for detail
       ► To make a class private
Question No: 23    ( Marks: 1 )    - Please choose one
When is a constructor called?
       ► Each time the constructor identifier is used in a program statement
       ► During the instantiation of a new object  (Object-Oriented Programming in C++)
       ► During the construction of a new class
       ► At the beginning of any program execution
Question No: 24    ( Marks: 1 )    - Please choose one
Consider the code below,
class Fred {
public:
Fred();
...
};
int main()
{
Fred a[10]; 
Fred* p = new Fred[10]; 
...
}
Select the best option,
       ► Fred a[10]; calls the default constructor 09 times
Fred* p = new Fred[10];  
       ► Produce an error
       ► Fred a[10]; calls the default constructor 11 times
Fred* p = new Fred[10];  calls the default constructor 11 times
       ► Fred a[10]; calls the default constructor 10 times
Fred* p = new Fred[10];  calls the default constructor 10 times      Click here for detail
Question No: 25    ( Marks: 1 )    - Please choose one
Associativity can be changed in operator overloading.
       ► True
       ► False     (Page 141)
Question No: 26    ( Marks: 1 )    - Please choose one
A normal C++ operator that acts in special ways on newly defined data types is said to be 
       ► glorified.
       ► encapsulated.
       ► classified.
       ► overloaded.   (Object-Oriented Programming in C++)
Question No: 27    ( Marks: 1 )    - Please choose one
Which operator can not be overloaded?
       ► The relation operator ( >= )
       ► Assignment operator ( = )
       ► Script operator ( [] )
       ► Conditional operator (? : )       (Page 141)
Question No: 28    ( Marks: 1 )    - Please choose one
Suppose obj1 and obj2 are two objects of a user defined class A. An + operator is overloaded to add obj1 and obj2 using the function call obj1+obj2.
Identify the correct function prototype against the given call?
       ► A operator + ( A &obj);
       ► int + operator();            (Page 143)
       ► int operator (plus) ();
       ► A operator(A &obj3);
Question No: 29    ( Marks: 1 )    - Please choose one
Default constructor is such constructor which either has no ---------or if it has some parameters these have -------- values
       ► Parameter, temporary
       ► Null, Parameter
       ► Parameter, default       (Page 75) rep
       ► non of the given   
Question No: 30    ( Marks: 1 )    - Please choose one
Public methods of base class can --------- be accessed in its derived class 
       ► directly       (Page 179) rep
       ► inderectly
       ► simultaniously
       ► non of the given

No comments:

Post a Comment