cs201

15
http://vustudents.ning.com/ FINALTERM EXAMINATION CS201- Introduction to Programming Question No: 1 ( Marks: 1 ) - Please choose one If it is required to copy an array to another array then, Both arrays must be of the same size and data type Both arrays may be of different size Both arrays may be of different data type Both arrays may be of different size and type Question No: 2 ( Marks: 1 ) - Please choose one Dealing with structures and functions passing by reference is the most economical method True False Question No: 3 ( Marks: 1 ) - Please choose one eof( ), bad( ), good( ), clear( ) all are manipulators. True False http://vustudents.ning.com/

Upload: naina

Post on 16-Aug-2015

214 views

Category:

Documents


0 download

DESCRIPTION

if you have anypapr in this subject then upload me kindly nd pray for me

TRANSCRIPT

http://vustudents.ning.com/FINALTERMEXAMINATION CS201- Introduction to Programming Question No: 1( Marks: 1 ) - Please choose one If it is required to copy an array to another array then, Both arrays must be of the same size and data type Both arrays may be of diferent size Both arrays may be of diferent data type Both arrays may be of diferent size and typeQuestion No: 2( Marks: 1 ) - Please choose one Dealing with structures and functions passingby reference is the most economical method True FalseQuestion No: 3( Marks: 1 ) - Please choose one eof( ), bad( ), good( ), clear( ) all are manipulators. True FalseQuestion No: 4( Marks: 1 ) - Please choose one http://vustudents.ning.com/http://vustudents.ning.com/Overloaded new operator function takes parameter of type size_t and returns void (nothing) void pointer object pointer int pointerQuestion No: 5( Marks: 1 ) - Please choose one When new operator is overloaded at global level then corresponding built-in new operator will not be visible to whole of the program. True FalseQuestion No: 6( Marks: 1 ) - Please choose one If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block? parentheses ( ) braces { } brackets [ ] http://vustudents.ning.com/http://vustudents.ning.com/ arrows < > Question No: 7( Marks: 1 ) - Please choose one he return type of a function that do not return any value must be!!!!!!!! float int void doubleQuestion No: 8( Marks: 1 ) - Please choose one "#$% has been developed in !!!!!!!! language. &'(' ) * +O,,'#Question No: ( Marks: 1 ) - Please choose one -ike member functions. !!!!!! can also access the private data members of a class.http://vustudents.ning.com/http://vustudents.ning.com/ #on-member functions +riend functions 'ny function outside class #one of the given optionsQuestion No: 1!( Marks: 1 ) - Please choose one / Which of the following statement is best regarding declaration of friend function +riend function must be declared after public keyword. +riend function must be declared after private keyword. +riend function must be declared at the top within class definition. $t can be declared anywhere in class as these are not affected by the public and private keywords.Question No: 11( Marks: 1 ) - Please choose one he operator function overloaded for an 'ssignment operator (0) must be #on-member function of class 1ember function of classhttp://vustudents.ning.com/http://vustudents.ning.com/ +riend function of class #one of the given optionsQuestion No: 12( Marks: 1 ) - Please choose one he en"l and #lush are !!!!!!! +unctions Operators 1anipulators ObjectsQuestion No: 13( Marks: 1 ) - Please choose one $f a symbolic constant has been defined. it will be an error to define it again. True FalseQuestion No: 14( Marks: 1 ) - Please choose one he operator used for casting. in *. is standard !!!!!!!! operator. none of the given options. casthttp://vustudents.ning.com/http://vustudents.ning.com/ cost constQuestion No: 15( Marks: 1 ) - Please choose one *onstructors can not be overloaded like ordinary functions. True FalseQuestion No: 16( Marks: 1 ) - Please choose one Which of the following function call is correct for the function prototype/default2arameters ( int a. int b 0 3. char 4 0 567 )8 default2arameters (9)8 default2arameters (9. 5:7)8 default2arameters (;. 5) operator then the number of argument it take is?are.http://vustudents.ning.com/http://vustudents.ning.com/ @ero One wo # argumentsQuestion No: 18( Marks: 1 ) - Please choose one We can not define a variable of user-defined data type in the class. True FalseQuestion No: 1( Marks: 1 ) - Please choose one When an object of a class is defined inside an other class then. *onstructor of enclosing class will be called first *onstructor of inner object will be called first *onstructor and Destructor will be called simultaneously #one of the given optionshttp://vustudents.ning.com/http://vustudents.ning.com/Question No: 2!( Marks: 1 ) - Please choose one he appropriate data type to store the number of rows and colums of the matriA is!!!!!!!!!!!!. float int char none of the given options.Question No: 21( Marks: 1 ) - Please choose one *lass is a user defined!!!!!!!!!!!. data type memory referee value none of the given options.Question No: 22( Marks: 1 ) - Please choose one A pointer variable can be, Decremented Incremented Multiplied Both Decremented and Decremented http://vustudents.ning.com/http://vustudents.ning.com/Question No: 23( Marks: 1 ) - Please choose one #"-- value has been defined in !!!!!! and !!!!!!!!! header files. strings.h and iostream.h ctype.h and conio.c conio.c and conio.h stdlib.h and stddef.hQuestion No: 24( Marks: 1 ) - Please choose one ' 1atriA can be composed of ints. floats or doubles as their elements. )est way is to handle this . !!!!!!!!!!!!!!! Write a separate class to handle each "se templates "se strings to store all types #one of the given optionsQuestion No: 25( Marks: 1 ) - Please choose one "setprecision" manipulator will sethttp://vustudents.ning.com/http://vustudents.ning.com/ The number of digits after the decimal point The number of digits before the decimal point The number of digits in a number None of the given optionsQuestion No: 26( Marks: 1 ) - Please choose one Which of the following option will be true. if we overload B-$% operator/ only - operator needs to be overloaded 1inus (-) and 0 operators need to be overloaded the -0 operator need to be overloaded eAplicitly the - and 0 operators need to be overloaded implicitlyQuestion No: 27( Marks: 2 ) Cuppose there is a template function 5#unc7 having argument of type " and return type . What will be the *>> syntaA to call this function. passing a variable 5&7 of type double and returning an int type/Question No: 28( Marks: 2 ) Which variable will be used in inner code block if we have the same names of variable at outer code block and inner code block/http://vustudents.ning.com/http://vustudents.ning.com/Question No: 2( Marks: 2 ) What is the benefit of reference and where can we use it/ Question No: 3!( Marks: 2 ) Write the *>>code for the declaration of overloadedstreaminsertionandstreameAtraction operator for the object " of type 'ate.Question No: 31( Marks: 3 ) What will be the output of following functions if we call these functions three times/1)void funcD()Eint A 0 =8A>>8cout FF A FF endl8G2) void funcH()Estatic int A 0 = 8A>>8cout FF A FF endl 8GQuestion No: 32( Marks: 3 ) $f the reIuested memory is not available in the system then what does calloc()alloc and ne* operator return/Question No: 33( Marks: 3 ) http://vustudents.ning.com/http://vustudents.ning.com/Cuppose an object of class ' is declared as data member of class ).(i) he constructor of which class will be called first/(ii) he destructor of which class will be called first/Question No: 34( Marks: 5 ) What is difference between "nary and binary operators and how they can be overloaded/Question No: 35( Marks: 5 ) Cuppose we have the following class.class Matrix{private:int Elements[3][3];};Write the operator function of stream eAtraction operator (JJ) for this class.Question No: 36( Marks: 5 ) What is meant by user interface and class interface in *>> / 'nd what role a class interface can play in user interface K1arks 9Lhttp://vustudents.ning.com/