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

CSE :: Object Oriented Programming Using C++

  1. When you define an object that is a member of a class, such as Student Abby; _____

  2. A.
    a block of memory is set aside and all data members are assigned valid values
    B.
    a block of memory is set aside
    C.
    no memory is set aside until values are defined
    D.
    no memory is set aside, but valid values are assigned to data members

  3. A program can directly access the _____ members of a class

  4. A.
    hidden
    B.
    private
    C.
    public
    D.
    both (b) and (c)

  5. Any output manipulator function you create _____

  6. A.
    should take as an argument an instance of ostream as a reference
    B.
    should return void
    C.
    must be a member function of the ostream class
    D.
    must inherit ostream

  7. To pass an array by reference, you

  8. A.
    must include the address-of (&) operator before the array's name
    B.
    must include the number symbol (#) before the array's name
    C.
    do not have to do anything because arrays are automatically passed by reference

  9. The instructions you enter into the computer are called the _____

  10. A.
    edited code
    B.
    machine code
    C.
    object code
    D.
    source code

  11. The String data type is an extension of the _____ data type

  12. A.
    Character
    B.
    Double
    C.
    Letter
    D.
    Long
    E.
    Text

  13. An advantage of using local variables is that _____

  14. A.
    they are known to all functions in the file
    B.
    names used in one function do not affect data stored in variables with the same names in other functions
    C.
    values given to local variables are retained when those parameters go out of scope
    D.
    the program does not become "crowded" with too many variable names

  15. The difference between a return and a throw is that _____

  16. A.
    with a throw, no value can be sent
    B.
    with a return, no value can be sent
    C.
    with a throw, execution takes place at the location from which the function was called
    D.
    with a return, execution takes place at the location from which the function was called

  17. Which is a good reason for passing a variable's address to a function?

  18. A.
    the function will have a copy of the variable
    B.
    the function cannot change the value of the variable in the calling function
    C.
    C++ requires that all variables used in a function be passed by address
    D.
    the function needs to change multiple variable values
    E.
    the called function can change the value of the variable in the calling function

  19. The string HELLO WORLD needs

  20. A.
    11 bytes
    B.
    12 bytes
    C.
    10 Bytes
    D.
    8 bytes
    E.
    None of the above