KING'S IT WORLD
please register to watch content in detail
THANKS
ADMIN KINGSIT WORLD

KING'S IT WORLD


 
HomeHome  CalendarCalendar  GalleryGallery  FAQFAQ  SearchSearch  UsergroupsUsergroups  RegisterRegister  Log inLog in  
Search
 
 

Display results as :
 
Rechercher Advanced Search
kings it world text ad
KINGSITWORLD CALENDAR
Follow me on G+
KINGSITWORLD WEATHER
Latest topics
» QURAN MAJEED KE TAFSEER
Mon Aug 20, 2012 2:59 am by YOUSUFHALI

» PHY301 CIRCUIT THEORY REFERENCE BOOK
Wed Jul 25, 2012 11:36 am by shabbir1915

» MTH202 ASSIGNMENT NO 3 SOLUVED
Mon Jun 11, 2012 9:51 am by jaffarhussain

» Retrieve the DTC In the Jewel Module of 1995 Ford
Thu May 31, 2012 11:51 am by obd2tool

» How you can Obvious the Check Engine Light on the
Thu May 31, 2012 11:43 am by obd2tool

» send free sms and send free sms update on facebook
Tue May 15, 2012 8:33 pm by rizwan269

» United Bank Limited (UBL) - Fee Deposit
Thu May 10, 2012 3:33 pm by irumnaz

» PHOTO MIXER SOFTWARE
Fri Apr 20, 2012 10:02 am by sacredwkb

» Entrepreneurship Survey
Thu Mar 08, 2012 2:20 pm by Admin

» Fall 2011 Semester Result Announced
Thu Mar 08, 2012 2:19 pm by Admin

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
kings it world text ad
Social bookmarking
Social bookmarking Digg  Social bookmarking Delicious  Social bookmarking Reddit  Social bookmarking Stumbleupon  Social bookmarking Slashdot  Social bookmarking Yahoo  Social bookmarking Google  Social bookmarking Blinklist  Social bookmarking Blogmarks  Social bookmarking Technorati  

Bookmark and share the address of KING'S IT WORLD on your social bookmarking website
visitors counter
Powered by website analytics technology.
Keywords
kings it world text ad
FLAG COUNTER
free counters
LIVE TRAFFIC

Share | 
 

 CS304 FINALTERM PAPERS 2010

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin
avatar

Scorpio
Posts : 638
Points : 2155
Reputation : 19
Join date : 2010-05-15
Age : 29
Location : islamabad

PostSubject: CS304 FINALTERM PAPERS 2010   Sat Aug 07, 2010 10:10 pm

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


A template argument is preceded by the keyword ________.

► vector

► class

► 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

► None of the given



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


A function template can not be overloaded by another function template.



► True


► 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

► 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;

A obj;

► A obj;

► Obj A;



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


The user must define the operation of the copy constructor.

► True

► 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.

► 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

► 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



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


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


► variable

► array

► function

► datatype



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


Suppose you create an uninitialized vector as follows:

vector 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.




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.

► 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



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.



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.

► 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

► False



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


________ and ______ methods may not be declared abstract.






► private,static

► 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

► 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

► 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

► 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

► 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



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


----------------- follow try block to catch the object thrown

► catch block

► 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



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


Destructor can be overloaded


► True

► False



Question No: 27 ( Marks: 2 )


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

Template templatename
Class calssname
{
Friend void friend templatename (classname astric const prt classname);
}



Question No: 28 ( Marks: 2 )


State any two reasons why the virtual methods can not be static?

1-virtual method can not be static as it is dynamic
2-as virtual method is dynamic so it works automatically that is also another reason
That virtual method can not be static.


Question No: 29 ( Marks: 2 )


Explain the statement below,
vector ivec(4, 3);




Question No: 30 ( Marks: 2 )


Explain two benefits of setter functions.

1- It minimize the changes to move the objects in inconsistent states
2- You can write checks in your setter functions to check the validity of data entered by the user, for example age functions to check to calculate the age from date entered.


Question No: 31 ( Marks: 3 )


Consider the code below,

template< typename T >
class T1 {
public:
T i;
protected:
T j;
private:
T k;
friend void Test();
};

This code has a template class T1 with three members i,j and k and a friend function Test(), you have to describe which member/s of T1 will be available in function Test().


public:
T i;
protected:
T j;



Question No: 32 ( Marks: 3 )


What do you mean by Stack unwinding?
When we want to check what happens actually to the local variables in the try block when then an exception is thrown this concept is called stack unwinding.



Question No: 33 ( Marks: 3 )


Give the c++ code of case sensitive comparison function of string class.



Question No: 34 ( Marks: 5 )


What is random_iterator? What is relation between random_iterator and Vector?

Random_iterator: it provided both increment and decrement and also provide constant time methods for moving forward and backword in arbitrary sized steps. Ramdom iterator provide asentially all of the operations of ordinary c pointer arithmetic.

Vector class provide an stl style random access iterator for use with generic algorithm since neither the vactor nor the matrix classes are container classes in actuall. The iterator class is really an iterator of data object that is viewed by vector or matrix.




Question No: 35 ( Marks: 5 )


What would be the output of this code?

class mother {
public:
mother ()
{ cout << "mother: no parameters\n"; }
mother (int a)
{ cout << "mother: int parameter\n"; }
};

class daughter : public mother {
public:
daughter (int a)
{ cout << "daughter: int parameter\n\n"; }
};

class son : public mother {
public:
son (int a) : mother (a)
{ cout << "son: int parameter\n\n"; }
};

int main () {
daughter rabia (0);
son salman(0);

return 0;
}

Output will be

Mother
Daughter: rabia
Son: salman



Question No: 36 ( Marks: 5 )


The code given below has one template function as a friend of a template class,
1. You have to identify any error/s in this code and describe the reason for error/s.
2. Give the correct code after removing the error/s.

template
void Test(U);
template< class T >

class B {
int data;
public:
friend void Test<>( T );
};

template
void Test(U u){
B < int> b1;
b1.data = 7;
}
int main(int argc, char *argv[])
{
char i;
Test(i);
system("PAUSE");
return 0;
}


Back to top Go down
View user profile
 
CS304 FINALTERM PAPERS 2010
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Mercredi 10 mars 2010 : l'horoscope
» Last years' Q Papers & Suggested Answers
» aptech online test sample papers
» Test papers are compulsory to get attempt in executive programme
» RE: GPPB Resolution No. 06-2010

Permissions in this forum:You cannot reply to topics in this forum
KING'S IT WORLD :: EDUCATION :: PAPERS :: SPRING 2010 FINAL TERM PAPERS (updated daily)-
Jump to: