CS201 Final Term Quiz File 4

No Comments
Question No: 1 When we define an array of objects then,
      ►Destructor will call once for whole array
      ►Destructor will call for each object of the array
      ►Destructor will never call
      ►Depends on the size of array
Question No: 2  We can also create an array of user define data type
      ►True
      ►False
Question No: 3 What is the sequence of event(s) when allocating memory using new operator?
      ►Only block of memory is allocated for objects
      ►Only constructor is called for objects
      ►Memory is allocated first before calling constructor
      ►Constructor is called first before allocating memory
Question No: 4  We can delete an array of objects without specifying [] brackets if a class is not doing dynamic memory allocation internally
      ►True
      ►False
Question No: 5 The declarator of Plus (+) member operator function is
      ►Class-Name  operator + (Class-Name  rhs)
      ►Operator Class-Name + ( )
      ►Operator Class-Name + ( rhs)
      ►Class-Name  operator + ( )
Question No: 6 The  second parameter of  operator  functions for  << and >> are objects of the class for which we are overloading these operators
      ►True (not sure)
      ►False
Question No: 7 Which  of  the  following  is  correct  way  to  initialize  a  variable  x  of  int  type  with value 10?
      ►int x ; x = 10 ;
      ►int x = 10 ;
      ►int x, x = 10;
      ►x = 10 ;
Question No: 8  Default mechanism of function calling in case of array is                              and in case of variable is _              
      ►Call by value, call by reference
      ►Call by referene, call by reference
      ►Call by reference, call by value
      ►Call by value, call by value
Question No: 9  What does STL stand for?
      ►Source template library
      ►Standard template library
      ►Stream template library
      ►Standard temporary library
Question No: 10  Skill(s) that is/are needed by programmers                                                                    
      ►Paying attention to detail
      ►Think about the reusability
      ►Think about user interface
      ►All of the given options
Question No: 11  For which array, the size of the array should be one more than the number of elements in an array?
      ►int
      ►double
      ►float
      ►char
Question No: 12 new and delete are                            whereas malloc and free are          
      ►Functions, operators
      ►Classes, operators
      ►Operators, functions
      ►Operators, classes
Question No: 13  The prototype of friend functions must be written                             the class and its definition must be written                        
      ►inside, inside the class
      ►inside, outside the class
      ►outside, inside the class
      ►outside, outside the class
 Question No: 14  Friend function of a class are                                  of a class.
      ►Non-member functions not sure
      ►Friend functions
      ►Any function outside class
      ►None of the given options
Question No: 15  If overloaded plus operator is implemented as non-member function then which of the following statement will be true for the statement given below?
obj3 = obj1 + obj2 ;
      ►obj2 will be passed as an argument to + operator whereas obj2 will drive the + operator
      ►obj1 will drive the + operator whereas obj2 will be passed as an argument
      ►to + operator
      ►Both objects (obj1, obj2) will be passed as arguments to the + operator
      ►Any of the objects (obj1, obj2) can drive the + operator
Question No: 16  Which  one  of  the  following  is  the  declaration  of  overloaded  pre-increment operator implemented as member function?
      ►Class-name operator +() ;
      ►Class-name operator +(int) ;
      ►Class-name operator ++() ;
      ►Class-name operator ++(int) ;
Question No: 17  For cin, the source is normally a                                    and destination can be               
      ►File, native data type
      ►Disk, user-define type
      ►Keyboard, variable
      ►File, user-define type
Question No: 18  We can do condition compilation with pre processor directives.
      ►True
      ►False.
Question No: 19  The programs, in which we allocate static memory, run essentially on                                      
      ►Heap
      ►System Cache
      ►None of the given options
      ►Stack
Question No: 20  A template function must have at least ---------- or more arguments
      ►Zero
      ►One
      ►Two
      ►Three
Question No: 21  The default value of a parameter can be provided inside the                 
      ►function prototype
      ►function definition
      ►both function prototype or function definition
      ►none of the given options
Question No: 22  While calling function, the arguments are assigned to the parameters from                            
      ►left to right
      ►right to left
      ►no specific order is followed
      ►none of the given options
Question No: 23  When an operator function is defined as member function for a binary Plus (+) operator then the number of argument it take is/are 
      ►Zero
      ►One
      ►Two
      ►N arguments
Question No: 24  new operator allocates memory from free store and return                    
      ►A pointer
      ►A reference
      ►An integer
      ►A float
Question No: 25  With user-defined data type variables (Objects), self assignment can produce        
      ►Syntax error not sure
      ►Logical error
      ►Link error
      ►Non of the given options
Question No: 26 Assignment operator is used to initialize a newly declared object from existing object
      ►True
      ►False
Question No: 27  When an object of a class is defined inside an other class then,
      ►Constructor of enclosing class will be called first
      ►Constructor of inner object will be called first
      ►Constructor and Destructor will be called simultaneously
      ►None of the given options
Question No: 28 In the member initializer list, the data members are initialized,
      ►From left to right
      ►From right to left
      ►In the order in which they are defined within class
      ►None of the given options
Question No: 29 "new" and "delete" keywords are                                              in C++ language
      ►Built-in- Function
      ►Operators
      ►Memory Allocation Function
      ►None of the given options
Next PostNewer Post Previous PostOlder Post Home

0 comments

Post a Comment