You are on page 1of 5

C++ Quiz 4

>REGISTERED

USER

Maximum time allowed is 10 Minutes

C++ Quiz 4
1. Operator overloading is a concept by which we can give special meaning to an operator of language an object of a language a concept of which we can design new object a class 2. Out of the following which operator cannot be overloaded += == * :: 3. If header of operator function is "operator ++( )" then this perfom prefix increment postfix increment this type of header not possible prefix decrement 4. If header of operator function is "operator ++ (int)" then this perform prefix increment postfix increment this type of header not possible postfix decrement

file:////192.168.55.254/Share/Books/C++ Quiz 4.html (1 of 5)10/20/2010 1:02:33 PM

C++ Quiz 4

5. The conversion from basic bype to class type can be done by Overloaded casting operator Object of a derived class Constructor Can not be possible 6. Pick the odd one out . . . :: ?: sizeof( ) *= 7. To use operators on class objects, they must be overloaded, with the exception of operators __________ , __________ and __________. Member access(dot), scope resolution(::) and conditional(?:) assignment (=), address (&), comma ( ,) Both of them None of them 8. The __________ , __________ and __________ of an operator cannot be changed by overloading the operator. precedence, associativity and arity. syntax, semantics and keyword string, class and object none of the above 9. The meaning of "<<" operator is left shift operator and stream extraction operator right shift operator and stream insertion operator left shift operator and stream insertion operator right shift operator and stream extraction operator

file:////192.168.55.254/Share/Books/C++ Quiz 4.html (2 of 5)10/20/2010 1:02:33 PM

C++ Quiz 4

10. Program components in C++ are called ________ and ________. object and inheritance class and polymorphism functions and classes arrays and functions 11. A variable that is known only within the function in which it is defined is called a(n) ________. Extern variable Global variable Formal variable local variable 12. The ________ statement in a called function passes the value of an expression back to the calling function. function call return compound simple 13. The keyword ________ is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters. int char null void

file:////192.168.55.254/Share/Books/C++ Quiz 4.html (3 of 5)10/20/2010 1:02:33 PM

C++ Quiz 4

14. A(n)________ allows the compiler to check the number, types and order of the arguments passed to a function. definition prototype call return 15. In C++, it is possible to have various functions with the same name that operate on different types or numbers of arguments. This is called function ________. overriding overloading underloading underriding 16. The ________ qualifier is used to declare read-only variables. void volatile const pattern 17. A function can have _____ number(s) of return value(s). one two three many

file:////192.168.55.254/Share/Books/C++ Quiz 4.html (4 of 5)10/20/2010 1:02:33 PM

C++ Quiz 4

18. Which of the following are valid reasons for overloading an operator? To speed up the program. To make the program more memory efficient. To have fun. To make it possible to perform arithmetic on objects of userdefined classes. 19. What is the name of the function that overloads the + operator for the airtime class? add airtime add operator+ operator 20. Conversions from class objects to basic types are carried out using a constructor. are carried out using an overloaded operator are carried out using a member function of the basic type are carried out using a cast operator member of the class.
Calculate Score Close Quiz

Time allowed: Top


10:00

Time remaining:
09:55

file:////192.168.55.254/Share/Books/C++ Quiz 4.html (5 of 5)10/20/2010 1:02:33 PM

You might also like