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

CSE :: Object Oriented Programming Using C++

  1. The #ifndef directive tests to see whether ________

  2. A.
    a class has been defined
    B.
    a variable has been given a value
    C.
    a class has no variable definitions
    D.
    any objects of the class have been instantiated

  3. Which of the following statements is false?

  4. A.
    A function is a block of code that performs a specific task
    B.
    Functions allow programmers to break large and complex problems into small and manageable tasks
    C.
    Functions allow programmers to use existing code to perform common tasks
    D.
    Functions can be called, or invoked, only once in a program
    E.
    Programmer-defined functions can be either value-returning or void

  5. The generic type in a template function

  6. A.
    must be T
    B.
    can be T
    C.
    cannot be T for functions you create, but may be for C++'s built-in functions
    D.
    cannot be T

  7. When a child class function is called, the compiler looks first for a matching function name in the _____

  8. A.
    class of the object using the function name
    B.
    immediate ancestor class
    C.
    base class
    D.
    descendant class

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

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

  11. If you create an instantiation of a class template with an int, and then create a second instantiation with a double, then

  12. A.
    you must precede each function call with the word int or double
    B.
    once a function is used as one type, it becomes unavailable for use with the other type
    C.
    there is no difference in the procedure to call a member function
    D.
    you cannot perform this operation in C++

  13. The step-by-step instructions that solve a problem are called _____

  14. A.
    an algorithm
    B.
    a list
    C.
    a plan
    D.
    a sequential structure

  15. The type to be used in an instantiation of a class template follows ________

  16. A.
    the generic class name
    B.
    the keyword template
    C.
    the keyword class
    D.
    the template definition

  17. Which of the following statements allows the user to enter data at the keyboard?

  18. A.
    cin << currentPay;
    B.
    cin >> currentPay;
    C.
    cout << currentPay;
    D.
    cout >> currentPay;
    E.
    None of the above

  19. When you pass a variable _____, C++ passes only the contents of the variable to the receiving function

  20. A.
    by reference
    B.
    by value
    C.
    globally
    D.
    locally