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

CSE :: Object Oriented Programming Using C++

  1. Programmer-defined functions can be

  2. A.
    value-returning functions only
    B.
    void functions only
    C.
    either value-returning or void functions

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. A class D can be derived from a class C, which is derived from a class B, which is derived from a class A

  4. A.
    True
    B.
    False

    View Answer

    Workspace

    Discuss Discuss in Forum


  5. To use the strcpy function, you must include the _____ header file in your program

  6. A.
    assign.h
    B.
    copy.h
    C.
    string.h
    D.
    strcopy.h
    E.
    strcpy.h

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. The number of the relational operators in the C language is

  8. A.
    four
    B.
    six
    C.
    three
    D.
    one
    E.
    None of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. Which of the following tells C++ to display numbers with two decimal places?

  10. A.
    setdecimal(2)
    B.
    setiosflags(2)
    C.
    setiosflags(2.00)
    D.
    setprecision(2)

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. A function that is called automatically each time an object is destroyed is a

  12. A.
    constructor
    B.
    destructor
    C.
    destroyer
    D.
    terminator

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. We can output text to an object of class ofstream using the insertion operator « because

  14. A.
    the ofstream class is a stream
    B.
    the insertion operator works with all classes
    C.
    we are actually outputting to cout
    D.
    the insertion operator is overloaded in ofstream

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. The operator that allocates new memory is _____

  16. A.
    allocate
    B.
    mem
    C.
    new
    D.
    next

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. A comment

  18. A.
    is a note that can be put into the source code
    B.
    is ignored by the compiler.
    C.
    starts with the /* character pair
    D.
    All of the above
    E.
    None of the above

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which of the following is(are) valid identifier(s)?

  20. A.
    record_1
    B.
    1 record
    C.
    return
    D.
    $tax
    E.
    None of the above

    View Answer

    Workspace

    Discuss Discuss in Forum