1. Here is the start of a class declaration:
        class Foo
        {
        public:
           Foo(int num);
           void fun1(Foo f);
           void fun2(const Foo f);
           void fun3(Foo f) const;
           ...
        }
    
    Which of the member functions can alter the PRIVATE member variables of the Foo object that activates the function?

    1. Only Foo can alter the private member variables of the object that activates the function.
    2. Two of the functions can alter the private member variables of the object that activates the function.
    3. Three of the functions can alter the private member variables of the object that activates the function.
    4. All of the functions can alter the private member variables of the object that activates the function.

    Answer: Three of the functions can alter the private member variables of the object that activates the function.

  2. What is the primary purpose of a constructor?
    1. To initialize the data members of an object as it is declared.
    2. To allow multiple classes to be used in a single program.
    3. To copy an actual calling argument to a function's parameter.
    4. To free the dynamic memory used by an object.

    Answer: To initialize the data members of an object as it is declared.

  3. Which kind of functions can access private member variables of a class?
    1. Friend functions of the class
    2. Private member functions of the class
    3. Public member functions of the class
    4. All of the above can access private member variables
    5. None of the above

    Answer: All of the above can access private member variables