C++ Chap 9 And 13

76 Questions  I  By Clilfellac
Please take the quiz to rate it.

C++ Chap 9 And 13

  
Changes are done, please start the quiz.


Questions and Answers

Removing question excerpt is a premium feature

Upgrade and get a lot more done!
  • 1. 
    Each byte in memory is assigned a unique __________.

  • 2. 
    The __________ operator can be used to determine a variable's address

  • 3. 
    _____________ variables are designed to hold addresses.

  • 4. 
    The ____________ operator can be used to work with the variable a pointer points to.

  • 5. 
    Array names can be used as _____________, and vice versa.

  • 6. 
    Creating variables while a program is running is called __________.

  • 7. 
    The __________ operator is used to dynamically allocate memory.

  • 8. 
    Under older compilers, if the new operator cannot allocate the amount of memory  requested, it returns __________.

  • 9. 
    A pointer that contains the address 0 is called a(n) __________ pointer.

  • 10. 
    When a program is finished with a chunk of dynamically allocated memory, it should  free it with the __________ operator.

  • 11. 
    You should only use pointers with delete that were previously used with  __________.

  • 12. 
    34. The & symbol is called the indirection operator.
    • A. 

      True

    • B. 

      False


  • 13. 
    35. The & operator dereferences a pointer.
    • A. 

      True

    • B. 

      False


  • 14. 
    36. When the indirection operator is used with a pointer variable, you are actually working with the value the pointer is pointing to.
    • A. 

      True

    • B. 

      False


  • 15. 
    37. Array names cannot be dereferenced with the indirection operator.
    • A. 

      True

    • B. 

      False


  • 16. 
    38. When you add a value to a pointer, you are actually adding that number times the size of the data type referenced by the pointer. erator.
    • A. 

      True

    • B. 

      False


  • 17. 
    39. The address operator is not needed to assign an arrays address to a pointer.  
    • A. 

      True

    • B. 

      False


  • 18. 
    40. You can change the address that an array name points to.  
    • A. 

      True

    • B. 

      False


  • 19. 
    41. Any mathematical operation, including multiplication and division, may be performed on a pointer.
    • A. 

      True

    • B. 

      False


  • 20. 
    42. Pointers may be compared using the relational operators.  
    • A. 

      True

    • B. 

      False


  • 21. 
    43. When used as function parameters, reference variables are much easier to work with than pointers.  
    • A. 

      True

    • B. 

      False


  • 22. 
    44. The new operator dynamically allocates memory.
    • A. 

      True

    • B. 

      False


  • 23. 
    45. A pointer variable that has not been initialized is called a null pointer.  
    • A. 

      True

    • B. 

      False


  • 24. 
    46. The address 0 is generally considered unusable.  
    • A. 

      True

    • B. 

      False


  • 25. 
    47. In using a pointer with the delete operator, it is not necessary for the pointer to have been previously used with the new operator.
    • A. 

      True

    • B. 

      False


  • 26. 
    31. Each byte of memory is assigned a unique address.  
    • A. 

      True

    • B. 

      False


  • 27. 
    32. The * operator is used to get the address of a variable
    • A. 

      True

    • B. 

      False


  • 28. 
    33. Pointer variables are designed to hold addresses.
    • A. 

      True

    • B. 

      False


  • 29. 
    17. The two common programming methods in practice today are _________ and _________.  

  • 30. 
    18. _________ programming is centered around functions or procedures.  

  • 31. 
    19. _________ programming is centered around objects.  

  • 32. 
      20. _________ is an object s ability to contain and manipulate its own data.  

  • 33. 
    21. In C++ the _________ is the construct primarily used to create objects.

  • 34. 
    22. A class is very similar to a(n) _________.  

  • 35. 
    23. A(n) _________ is a key word inside a class declaration that establishes a member s   

  • 36. 
    24. The default access specification of class members is _________.  

  • 37. 
    25. The default access specification of a struct in C++ is _________.  

  • 38. 
    26. Defining a class object is often called the _________ of a class.

  • 39. 
    27. Members of a class object may be accessed through a pointer to the object by using  the _________ operator.  

  • 40. 
    28. If you were writing the declaration of a class named Canine, what would you name  the file it was stored in? _________  

  • 41. 
    29. If you were writing the external definitions of the Canine class s member functions,  you would save them in a file named _________.  

  • 42. 
      30. When a member function s body is written inside a class declaration, the function is  _________.  

  • 43. 
    31. A(n) _________ is automatically called when an object is created.

  • 44. 
    32. A(n) _________ is a member function with the same name as the class.  

  • 45. 
    33. _________ are useful for performing initialization or setup routines in a class object.  

  • 46. 
    34. Constructors cannot have a(n) _________ type.  

  • 47. 
    35. A(n) _________ constructor is one that requires no arguments. .

  • 48. 
    36. A(n) _________ is a member function that is automatically called when an object is  destroyed.

  • 49. 
    37. A destructor has the same name as the class, but is preceded by a(n) _________ character.  

  • 50. 
    38. Like constructors, destructors cannot have a(n) _________ type.  

  • 51. 
    39. A constructor whose arguments all have default values is a(n) _________ constructor.  

  • 52. 
    40. A class may have more than one constructor, as long as each has a different  _________.  

  • 53. 
    41. A class may only have one default _________ and one _________.  

  • 54. 
    42. A(n) _________ may be used to pass arguments to the constructors of elements in an  object array.

  • 55. 
    51. Private members must be declared before public members.  
    • A. 

      True

    • B. 

      False


  • 56. 
    52. Class members are private by default.  
    • A. 

      True

    • B. 

      False


  • 57. 
    53. Members of a struct are private by default.  
    • A. 

      True

    • B. 

      False


  • 58. 
    54. Classes and structures in C++ are very similar.  
    • A. 

      True

    • B. 

      False


  • 59. 
      55. All private members of a class must be declared together.  
    • A. 

      True

    • B. 

      False


  • 60. 
    56. All public members of a class must be declared together.  
    • A. 

      True

    • B. 

      False


  • 61. 
    57. It is legal to define a pointer to a class object.  
    • A. 

      True

    • B. 

      False


  • 62. 
    58. You can use the new operator to dynamically allocate an instance of a class.  
    • A. 

      True

    • B. 

      False


  • 63. 
    59. A private member function may be called from a statement outside the class, as long as the statement is in the same program as the class declaration.  
    • A. 

      True

    • B. 

      False


  • 64. 
    60. Constructors do not have to have the same name as the class.
    • A. 

      True

    • B. 

      False


  • 65. 
    61. Constructors may not have a return type.  
    • A. 

      True

    • B. 

      False


  • 66. 
    62. Constructors cannot take arguments.  
    • A. 

      True

    • B. 

      False


  • 67. 
    63. Destructors cannot take arguments.  
    • A. 

      True

    • B. 

      False


  • 68. 
    64. Destructors may return a value.  
    • A. 

      True

    • B. 

      False


  • 69. 
    65. Constructors may have default arguments.  
    • A. 

      True

    • B. 

      False


  • 70. 
    66. Member functions may be overloaded.  
    • A. 

      True

    • B. 

      False


  • 71. 
    67. Constructors may not be overloaded.  
    • A. 

      True

    • B. 

      False


  • 72. 
    68. A class may not have a constructor with no parameter list, and a constructor whose arguments all have default values.  
    • A. 

      True

    • B. 

      False


  • 73. 
    69. A class may only have one destructor.  
    • A. 

      True

    • B. 

      False


  • 74. 
    70. When an array of objects is defined, the constructor is only called for the first element.  
    • A. 

      True

    • B. 

      False


  • 75. 
    71. To find the classes needed for an object-oriented application, you identify all of the verbs in a description of the problem domain.  
    • A. 

      True

    • B. 

      False


  • 76. 
    72. A classes responsibilities are the things the class is responsible for knowing, and actions the class must perform.
    • A. 

      True

    • B. 

      False


Back to top

Removing ad is a premium feature

Upgrade and get a lot more done!
Take Another Quiz
We have sent an email with your new password.