C++ Mathematical ADT - Quiz Explanation

The correct answers are indicated below, along with text that explains the correct answers.

 
1. A user-defined type's public behavior should be dictated by
  A. the classes available in a library
  B. what is most efficient
  C. the most narrow construct that supports its needs
  D. expectations found in the community that uses it
  The correct answer is D. Community conventions are the determiners of the public interface. These community conventions are the "controls" on the "black box."

2. When creating a mathematical ADT you should overload
  A. all possible mathematical operators
  B. all those mathematical operators that make sense for the class
  C. only those mathematical operators for which you have immediate use
  D. no operators--they are overloaded automatically by the compiler
  The correct answer is B. This is related to the previous quiz question. Math types have conventions for their operators. It's a bad idea to create "personal algebras."

3. Binary operators that are overloaded
  A. should generally be friend functions because this allows more natural use of the operators
  B. must be friend function. There is no other way to implement the overload.
  C. should generally be a member function because this provides the best privacy
  D. can be either friend or member function. Neither method is better.
  The correct answer is A.
Binary operators are often symmetrical in how they treat arguments. Passing both arguments through the function argument list treats them alike.