Interaction Diagram Quiz - Explanation

The correct answers are indicated below, along with text that explains the correct answers.
 
1. The purpose of the interaction diagram is to
Please select the best answer.
  A. Discover and define the communication between objects
  B. Discover and define the sequence of interactions between objects
  C. Discover and define the interfaces on classes
  D. Discover and define the attributes that define an object
  The correct answer is C.
The purpose of the interaction diagram is to discover and define the interfaces on classes. A is incorrect because identifying the communication between objects is just one step toward the goal of finding interfaces. B is incorrect because the sequence of interactions is already defined in the scenarios. D is incorrect because interfaces imply not only attributes but operations as well.

2. The definition of an operation includes
Please select the best answer.
  A. Name, arguments, and return data type where the return data type is optional
  B. Constraints, name, and arguments where the return data type and constraints are optional
  C. Return data type, name, and constraints where the return data type and constraints are all optional
  D. Name, arguments, return data type, and constraints where the arguments, return data type, and constraints are all optional
  The correct answer is D.
The definition of an operation includes a name, arguments, return data type, and constraints. A is incorrect because it does not include constraints. B is incorrect because the arguments are also optional. C is incorrect because it does not include arguments.

3. What elements are discovered using the sequence diagram and added to the class diagram?
Please select the best answer.
  A. Interfaces of the objects
  B. Classes of the objects in the sequence diagram, attributes, and operations
  C. Classes of the objects in the sequence diagram
  D. Operations and the associated attributes that appear as arguments in the operation definition
  The correct answer is B.
The elements of the sequence diagram that are added to the class diagram are the classes of the objects in the sequence diagram, attributes, and operations. A is incorrect because it does not include attributes. C is incorrect because it does not include operations and attributes. D is incorrect because it does not include the classes that represent the objects that participate in the scenario.

4. An attribute definition includes
Please select the best answer.
  A. Name, data type, and default value if applicable
  B. Name, arguments, and constraints
  C. Constraints, data type, and a default value if applicable
  D. Name, data type, default value, and constraints if applicable
  The correct answer is D.
An attribute definition includes name, data type, default value, and constraints. A is incorrect because it does not include constraints. B is incorrect because it does not include a default value. C is incorrect because it does not include a name.

5. Where can you find attributes in a sequence diagram?
Please select the best answer.
  A. In operation arguments
  B. In the objects that own the parameters' values
  C. In the responses to events
  D. In operation parameters and responses
  The correct answer is D.
Attributes can be found in event parameters and responses. A is incorrect because it does not include the responses. B is incorrect because it does not include operation parameters and responses. C is incorrect because it does not include event parameters.

6. If an object does not own the parameters it uses in an operation, then where do you look?
Please select the best answer.
  A. In the class diagram for a class that should own the data
  B. In the responding object
  C. In the sending object
  D. In other sequence diagrams that use the same type of parameters
  The correct answer is A.
Look in the class diagram for a class that should own the data. B is incorrect because the responding object is the receiver of the parameters so it can't have the attributes. C is incorrect because the question says that the sending object does not own the attributes used in the parameters. D is incorrect because although other sequence diagrams might use the same parameters, ultimately you have to look in the class diagram.

7. How does the sending object obtain data from the object that owns the parameter values?
Please select the best answer.
  A. By adding an interface to the sending object and adding it to the interaction sequence
  B. By adding an interface to the owning object and adding it to the interaction sequence
  C. By reassigning the attributes to the object that receives the parameters
  D. By reassigning the attributes to the object that sends the parameters
  The correct answer is B.
Obtain the data by adding an interface to the owning object and adding it to the interaction sequence. A is incorrect because the sending object does not own the data. Adding an interface doesn't help.
C and D are incorrect because the data should remain with the object that owns it. It should not be relocated simply because another object uses it.