Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CS304- Object Oriented Programming current final term paper July 2011
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#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

► Dynamic allocation



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

► None of the given



Question No: 3 ( 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

► Overloading

► Data hiding

► Encapsulation



Question No: 4 ( Marks: 1 ) - Please choose one

Which of the following is the best approach to implement generic algorithms with minimum number of coding lines?











► Templates

► Overloading

► Overriding

► Friend function/class



Question No: 5 ( Marks: 1 ) - Please choose one

Like template functions, a class template may not handle all the types successfully.







► True

► False



Question No: 6 ( Marks: 1 ) - Please choose one

A class template may inherit from another class template.









► True

► False



Question No: 7 ( 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.

► protected members of Derv.

► private members of Derv.

► protected members of Base.



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.

► a function returns by reference.

► an argument is passed by reference.



Question No: 9 ( Marks: 1 ) - Please choose one

Each try block can have ______ no. of catch blocks.



► 1

► 2

► 3

► As many as necessary.





Question No: 10 ( Marks: 1 ) - Please choose one

class DocElement

{

public:

virtual void Print() { cout << "Generic element"; }

};

class Heading : public DocElement

{

public:

void Print() { cout << "Heading element"; }

};

class Paragraph : public DocElement

{

public:

void Print() { cout << "Paragraph element"; }

};

void main()

{

DocElement * p = new Paragraph();



p->Print();

}



When you run this program, it will print out a single line to the console output.



What will be in that line?



Select one correct answer from the following list:



► Generic element



► Heading element



► Paragraph element



► Nothing will be printed.



Question No: 11 ( Marks: 1 ) - Please choose one

Suppose we have two derived classes from a single class, can we write a method with same name in both these derived classes ? Choose the best option.

► No

► Only if the two classes have the same name

► Only if the main program does not declare both kinds

► Yes



Question No: 12 ( Marks: 1 ) - Please choose one

When a virtual function is called by referencing a specific object by name and using the dot member selection operator (e.g., squareObject.draw()), the reference is resolved at compile time.



► True

► False



Question No: 13 ( Marks: 1 ) - Please choose one

Considering the resolution order in which compiler search for functions in a program; the first priority is given to,









► general template

► partial specialization

► complete specialization

► ordinary function



Question No: 14 ( Marks: 1 ) - Please choose one

Vectors contain contiguous elements stored as a[an] ___.



► variable

► array

► function

► datatype



Question No: 15 ( Marks: 1 ) - Please choose one

By default the vector data items are initialized to ____





► 0

► 0.0

► 1

► null



Question No: 16 ( Marks: 1 ) - Please choose one

One purpose of an iterator in the STL is to connect algorithms and containers.



► True

► False



Question No: 17 ( Marks: 1 ) - Please choose one

Algorithms can only be implemented using STL containers.



► True

► False



Question No: 18 ( Marks: 1 ) - Please choose one

In ________, a base class can be replaced by its derived class,

► Sub-typing

► Super-typing

► Multiple-typing

► Restricted-typing



Question No: 19 ( Marks: 1 ) - Please choose one

this pointer does not point to current object of any class,

► True

► False



Question No: 20 ( Marks: 1 ) - Please choose one

Which of the following operator(s) take(s) one or no argument if overloaded?













► ++

► -

► +

► All of the given



Question No: 21 ( Marks: 1 ) - Please choose one

Which of the following operators can not be overloaded?















► Scope resolution operator ( :: )

► Insertion operator ( << )

► Extraction operator ( >> )

► The relation operator ( > )



Question No: 22 ( Marks: 1 ) - Please choose one

The type that is used to declare a reference or pointer is called its ---------

► default type

► static type

► abstract type

► reference type



Question No: 23 ( Marks: 1 ) - Please choose one

------------- members are somewhere between public and private members. They are used in inheritance

► protected

► public

► private

► global



Question No: 24 ( Marks: 1 ) - Please choose one

Which of these are examples of error handling techniques ?

► 

► Graceful Termination

► Return the illegal

► all of the given



Question No: 25 ( Marks: 1 ) - Please choose one

_______ is a relationship



► Inheritance

► Polymarphism

► abstraction

► encapsulation



Question No: 26 ( 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



Question No: 27 ( Marks: 2 )

Describe the way to declare a template function as a friend of any class.





Question No: 28 ( Marks: 2 )

Give the names of any two types of template.







Question No: 29 ( Marks: 2 )

Explain the statement below,

vector<int> ivec(4, 3);





Question No: 30 ( Marks: 2 )

Q. Enlist the kinds of association w.r.t Cardinality (3)





Question No: 31 ( Marks: 3 )

Give three advantages that Iterators provide over Cursors.





Question No: 32 ( Marks: 3 )

Give the differences between virtual inheritance and multiple inheritance.





Question No: 33 ( Marks: 3 )

If we declare a function as friend of a template class will it be a friend for a particular data type or for all data types of that class.





Question No: 34 ( Marks: 5 )

See the 5 code snippets below and tell whether these are correct or incorrect also justify your answers in the table given at the end.



Snippet No.1



template< class T>

class A {

} ;

template< class T >

class B : public A< T* >

{ … }



Snippet No.2



template< >

class B< int* > : public A< T* >

{ … }







Snippet No.3

class B : public A< T* >

{ … }

Snippet No.4

template< >

class B< char* > : public A

{ … };



Snippet No.5

template< class T >

class B : public A< T* >

{ … }



Table:



Snippet No.


Is it correct or not (Correct/ Incorrect)


Justification of your answer

1







2







3







4







5















Question No: 35 ( Marks: 5 )

What is the output produced by the following program?



#include<iostream.h>



void sample_function(double test) throw (int);



int main()

{

try

{

cout <<”Trying.\n”;

sample_function(98.6);

cout << “Trying after call.\n”;

}

catch(int)

{

cout << “Catching.\n”;

}



cout << “End program.\n”;

return 0;

}

void sample_function(double test) throw (int)

{

cout << “Starting sample_function.\n”;

if(test < 100)

throw 42;

}





Question No: 36 ( Marks: 5 )

Suppose the base class and the derived class each have a member function with the same signature. When you have a pointer to a base class object and call a function member through the pointer, discuss what determines which function is actually called, the base class member function or the derived-class function.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  MCM301 MIDTERM solve paper 2011 Vuhelper 4 24,765 03-07-2015, 04:34 PM
Last Post: Xpert
  mgt602 midterm paper 3000 mcq's Xpert 5 11,342 05-30-2013, 02:16 PM
Last Post: Vuhelper
  All Solved Past Papers Mid & Final Term 2008 And 2009 viki 19 15,962 06-09-2012, 05:38 PM
Last Post: gr8touchstone@hotmail.com
  MID TERM PAST PAPER CS401 - Computer Architecture and Assembly SOLVE AND UNSOLVED usmanali126 2 6,378 04-13-2012, 03:27 PM
Last Post: Xpert
  Solved Paper MGT101 Fall 2009 Final Term viki 12 55,613 02-07-2012, 10:52 PM
Last Post: Xpert
  CS304 final term current paper spring Jily 2011 Vuhelper 1 3,503 02-04-2012, 10:34 PM
Last Post: roshi786
  Solved Paper of Final Term 2009 MTH101 Calculus And Analytical Geometry viki 8 11,991 02-04-2012, 12:47 AM
Last Post: Xpert
  CS101 Introduction to Computing FINAL TERM PAPERS SOLVED MCQS January 2012 Vuhelper 2 7,077 02-04-2012, 12:46 AM
Last Post: Xpert
  eng 201 final term paper Business and Technical English Writing January 2012 Vuhelper 3 7,251 01-30-2012, 06:52 PM
Last Post: Xpert
  CS101- Introduction to Computing FINALTERM EXAMINATION mega paper 2012 Vuhelper 0 7,614 01-29-2012, 10:18 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support