Home / CSE / Object Oriented Programming Using C++ :: Section 3

CSE :: Object Oriented Programming Using C++

  1. The last statement in a function is often a(n) _____

  2. A.
    return
    B.
    goodbye
    C.
    finish
    D.
    endfunction

  3. When the function int someFunction(char c) throw( ) is executed, _____

  4. A.
    it can throw anything
    B.
    it may throw an integer
    C.
    it may throw a character
    D.
    it may not throw anything

  5. The two statements that can be used to change the flow of control are

  6. A.
    if and switch
    B.
    if and while
    C.
    switch and do-while
    D.
    break and continue
    E.
    None of the above

  7. If p and q are assigned the values 2 and 3 respectively then the statement p = q++

  8. A.
    gives an error message
    B.
    assigns a value 4 to p
    C.
    assigns a value 3 to p
    D.
    assigns a value 5 to p
    E.
    None of the above

  9. Which of the following is the insertion operator?

  10. A.
    >>
    B.
    <<
    C.
    //
    D.
    /*
    E.
    both (a) and (b)

  11. If you want only one memory location to be reserved for a class variable, no matter how many objects are instantiated, you should declare the variable as

  12. A.
    static
    B.
    unary
    C.
    dynamic
    D.
    volatile

  13. To use a template class member function, use the ________ with the instantiation

  14. A.
    scope resolution operator
    B.
    dot operator
    C.
    class definition
    D.
    keword template

  15. When a class is derived from another derived class, the newly derived class

  16. A.
    may have more liberal access to a base class member than its immediate predecessor
    B.
    may have the same type of access to a base class member as its immediate predecessor
    C.
    may have more limited access to a base class member than its immediate predecessor
    D.
    both (b) and (c)

  17. If you assign a default value to any variable in a function prototype's parameter list, then _____

  18. A.
    all other parameters in the function prototype must have default values
    B.
    all parameters to the right of that variable must have default values
    C.
    all parameters to the left of that variable must have default values
    D.
    no other parameters in that prototype can have default values

  19. The dot operator (or class member access operator) connects the following two entities (reading from left to right):

  20. A.
    a class member and a class object
    B.
    a class object and a class
    C.
    a class and a member of that class
    D.
    a class object and a member of that class