Wednesday, 8 February 2012

CS304 Final Term Past Solved Paper (5)



FINAL TERM EXAMINATION
SPRING 2010



Question No: 1 ( Marks: 1 ) - Please choose one
Classes like Two Dimensional Shape and Three Dimensional Shape would normally be concrete, while
classes like Sphere and Cube would normally be abstract.
► True     Click here for detail    rep
► False
Question No: 2 ( Marks: 1 ) - Please choose one
Each try block can have ______ no. of catch blocks.
► 1
► 2
► 3
► As many as necessary.     Click here detail
Question No: 3 ( Marks: 1 ) - Please choose one
Function templates should be used where code and behavior must be identical.
► True       (Page 262)
► False
Question No: 4 ( Marks: 1 ) - Please choose one
Consider the following statement 
Cupboard has books
What is the relationship between Cupboard and books?
► Composition
► Aggregation
► Inheritance
► None of the given options

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
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: 8 ( 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: 9 ( Marks: 1 ) - Please choose one
How the information hidden within an object can be accessed?
► Through its interface
► Through its private data members
► Through its private member functions
► Through both public and private members

Question No: 10 ( Marks: 1 ) - Please choose one
The sub-object’s life is not dependant on the life of master class in __________.
► Separation
► Composition
► Aggregation     (Page 134)
► None of the given

Question No: 11 ( Marks: 1 ) - Please choose one
Encapsulation means 
Select correct option:
►Extending the behaviour of class in another class
►Data and behaviour are tightly coupled within an entity     (Page 16)
►One entity takes all the attributes and operations of the other
►Taking out the common features and put those in a separate class

Question No: 12 ( Marks: 1 ) - Please choose one
Algorithms can only be implemented using STL containers.
► True
► False      (Object-Oriented Programming in C++)  rep 
Question No: 13 ( Marks: 1 ) - Please choose one
When we write a class template the first line must be:
► template < class class_name>
► template < class data_type>
► template < class T >    (Page 257)    rep
    Here T can be replaced with any name but it is preferable.
► class class-name()
class template<class_name>
Question No: 14 ( 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++)
► organize the way objects are stored in memory
Question No: 15 ( Marks: 1 ) - Please choose one
___________, which means if A declares B as its friend it does NOT mean that A can access private data
of B. It only means that B can access all data of A.
► Friendship is one way only     Click here for detail
► Friendship is two way only
► NO Friendship between classes
► Any kind of friendship
 Question No: 16 ( Marks: 1 ) - Please choose one
Which of the following may not be an integral part of an object?
► State
► Behavior
► Protected data members  (Page 12)
► All of given

Question No: 17 ( 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
Question No: 18 ( Marks: 1 ) - Please choose one
If a class D has been derived using protected inheritance from class B (If B is a protected base and D is
derived class) then public and protected members of B -------- accessed by member functions and friends
of class D and classes derived from D
► can be         Click here for detail
► cannot be
► does restirct to be
► not given
Question No: 19 ( Marks: 1 ) - Please choose one
What is true about function templates?
► The compiler generates only one copy of the function template
► The compiler generates a copy of function respective to each type of data   (Page 256)
► The compiler can only generate copy for the int type data
► None of the given.
Question No: 20 ( Marks: 1 ) - Please choose one
Which of the following is an integral part of an object?
► State
► Behavior
► Unique identity
► All of the given    (Page 12) rep
Question No: 21 ( 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           

No comments:

Post a Comment