} a) n equals 1 (ans) b) n equals 2 c) n>=1 d) n>1 In which of the following situations can a constructor be invoked? a) When an object is created(ans) b) When an object is assigned the value 0 c) Only at the end of the code d) When the scope of the object is over A programmer prepares a questionnaire with “true or false” type of questions. He wants to define a data type that stores the responses of the candidates for the questions. Which of the following is the most suited data type for this purpose? a) Integer b) Boolean(ans) c) Float d) Character A sorting mechanism uses the binary tree concept such that any number in the tree is larger than all the numbers in the sub-tree below it. What is this method called? a) Selection sort b) Insertion sort c) Heap sort (ans) d) Quick sort A programmer mistakenly writes “gor” instead of the keyword “for” used in loops, while writing a program in C++.what will this result in?
a) The code would not compile. (ans) b) The code would give an error while execution. c) The code may work for some inputs and not for the others. d) The code would not create any problem. A programmer writes a sorting algorithm that takes different amount of the time to sort two different lists of equal size. what is the possible difference between the two lists? a) All number in one lists are more than 100 while in the other are less than 100. b) The ordering of numbers with respect to the magnitude in the two lists has different properties.(ans) c) One list has all negative numbers while the other has all positive numbers. d) One list contains 0 as an element while the other does not. Refer to the pseudo code given in the ‘passage’. The code is similar to that in C++ and is self-explanatory. An accessible member function and a data member for an object are accessed by the statements objectname.functionname and objectname.datamembername, respectively. Which statement should be deleted from the code to rectify the error in it? Class brush { Private: Integer size,c rcode function getdata(){…..}//statement 1 public: