Wednesday, 8 February 2012

CS304 Final Term Past Solved Paper (2)


FINA LTERM EXAMINATION
Spring 2010
CS304- Object Oriented Programming

Question No: 1      ( Marks: 1 ) - Please choose one
A template argument is preceded by the keyword ________. 

       ► vector
       ► class    (Object-Oriented Programming in C++)   
       ► template
       ► type*

Question No: 2      ( Marks: 1 ) - Please choose one
Which of the following causes run time binding?

       ► Declaring object of abstract class
       ► Declaring pointer of abstract class
       ► Declaring overridden methods as non-virtual   (Page 226)
       ► None of the given       
 Question No: 3      ( Marks: 1 ) - Please choose one
A function template can not be overloaded by another function template.
       ► True     (Object-Oriented Programming in C++)
       ► False
Question No: 4      ( Marks: 1 ) - Please choose one
Which of the following is the best approach if it is required to have more than one functions having exactly same functionality and implemented on different data types?
       ► Templates      (Page 256)   rep
       ► Overloading
       ► Data hiding
       ► Encapsulation
Question No: 5      ( Marks: 1 ) - Please choose one
Identify the correct way of declaring an object of user defined template class A for char type members?
       ► A< char > obj;    (Object-Oriented Programming in C++)
       ► <char>A obj;
       ► A obj<char>;
       ► Obj <char> A; 
Question No: 6      ( Marks: 1 ) - Please choose one
The user must define the operation of the copy constructor.

       ► True       Click here for detail
       ► False     
Question No: 7      ( Marks: 1 ) - Please choose one
Template functions use _________ than ordinary functions.
       ► Greater Memory
       ► Lesser Memory
       ► Equal Memory
       ► None of the given options
Question No: 8      ( Marks: 1 ) - Please choose one
The find() algorithm  
       ► finds matching sequences of elements in two containers. 
       ► finds a container that matches a specified container. 
       ► takes iterators as its first two arguments.    (Object-Oriented Programming in C++)
       ► takes container elements as its first two arguments. 

Question No: 9      ( Marks: 1 ) - Please choose one
Compiler performs ________ type checking to diagnose type errors,
       ► Static   (Page 261)
       ► Dynamic
       ► Bound
       ► Unbound
Question No: 10      ( 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: 11      ( Marks: 1 ) - Please choose one
Vectors contain contiguous elements stored as a[an] ___.
      ► variable
      ► array     (Page 306)
      ► function
      ► datatype 
Question No: 12      ( 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: 13      ( Marks: 1 ) - Please choose one
In a de-queue, (chose the best option)
       ► data can be quickly inserted or deleted at any arbitrary location. 
       ► data can be inserted or deleted at any arbitrary location, but the process is relatively slow. 
(Object-Oriented Programming in C++)
       ► data can not be quickly inserted or deleted at either end. 
       ► data can be inserted or deleted at either end, but the process is relatively slow. 
Question No: 14      ( Marks: 1 ) - Please choose one
Algorithms can only be implemented using STL containers. 
       ► True
       ► False      (Object-Oriented Programming in C++)
Question No: 15      ( Marks: 1 ) - Please choose one
What is a class?
       ► A class is a section of computer memory containing objects.
       ► A class is a section of the hard disk reserved for object oriented programs
       ► A class is the part of an object that contains the variables.
       ► A class is a description of a kind of object.       Click here for detail
Question No: 16      ( Marks: 1 ) - Please choose one
Inheritance is a way to
       ► organize data. 
       ► pass arguments to objects of classes. 
       ► add features to existing classes without rewriting them.  (Page 27)
       ► improve data-hiding and encapsulation.
Question No: 17      ( Marks: 1 ) - Please choose one
We can use "this" pointer in the constructor in the body and even in the initialization list of any class if we are careful, 
       ► True         Click here for detail
       ► False
Question No: 18      ( Marks: 1 ) - Please choose one
________ and ______ methods may not be declared abstract.

       ► private,static        Click here for detail
       ► private,public
       ► static,public
       ► none of given
Question No: 19      ( 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: 20      ( Marks: 1 ) - Please choose one
Public methods of base class can --------- be accessed in its derived class 
       ► directly      (Page 179)
       ► inderectly
       ► simultaniously
       ► non of the given
Question No: 21      ( Marks: 1 ) - Please choose one
The type that is used to declare a reference or pointer is called its ---------
       ► default type
       ► static type      (Page 185)
       ► abstract type
       ► reference type 
Question No: 22      ( Marks: 1 ) - Please choose one
------------- members are somewhere between public and private members. They are used in inheritance
       ► protected      (Page 187)
       ► public
       ► private
       ► global
Question No: 23      ( Marks: 1 ) - Please choose one
Which of these are examples of error handling techniques?
       ► Abnormal Termination
       ► Graceful Termination
       ► Return the illegal 
       ► all of the given         (Page 329)
Question No: 24      ( Marks: 1 ) - Please choose one
----------------- follow try block to catch the object thrown
       ► catch block         (Page 333)
       ► throw block
       ► main block
       ► non of the given
Question No: 25      ( Marks: 1 ) - Please choose one
Graphical representation of the classes and objects is called object model it shows -------
       ► Class Name only
       ► Class Name and attributes
       ► Relationships of the objects and classes
       ► all of the given      Click here for detail
Question No: 26      ( Marks: 1 ) - Please choose one
Destructor can be overloaded
       ► True
       ► False      (Page 92)

No comments:

Post a Comment