Free OMG-OCUP2-FOUND100 Exam Braindumps
OMG Certified UML Professional 2 (OCUP 2) - Foundation Level Questions 26–30 (page: 7)

Updated On: 9-Feb-2026

Choose the correct answer :

Given the diagram fragment below:



What are the possible values for the attribute response in the class Query?

  1. Maybe
  2. Yes. No, Maybe
  3. There is insufficient information to determine the answer.
  4. The diagram is not legal UML

Answer(s): B

Explanation:

The second diagram fragment you provided includes two enumeration types, YesNo and Answer, where YesNo is a generalization of Answer. The class Query has an attribute 'response' of type Answer. Given that YesNo is a generalization of Answer, the possible values for 'response' include the literals of Answer plus those inherited from YesNo. Since Answer includes 'Maybe', and YesNo includes 'Yes' and 'No', all three are valid values for 'response'.


Reference:

UML 2.x Superstructure Specification: Discusses attributes and their types, the concept of generalization, and how attributes of a generalized type can take on values from their own literals as well as those from their parent in the hierarchy.

UML 2.x Infrastructure Specification: Explains the foundational modeling constructs related to enumeration, classes, and attributes, which provides the basis for determining the legal values of an attribute based on its type's enumeration literals.



Choose the correct answer : Consider the following diagram:



Is this diagram valid?

  1. No, because a DataType cannot have Associations to a Class.
  2. No, because a DataType cannot have Operations.
  3. No, because a DataType cannot have Attributes.
  4. Yes, it is formally correct.

Answer(s): A

Explanation:

The provided diagram depicts a DataType named Route with operations, attributes, and associations to a Class named City. In UML, a DataType is a type of classifier that specifies the values that do not have identity (i.e., are not distinguishable from other objects). DataTypes may contain Attributes and Operations, so options B and C are incorrect.

However, DataTypes should not have associations to Classes because DataTypes are meant to be value types without identity, and associations typically imply a relationship between instances (which have identity). Thus, the presence of associations from Route to City is not consistent with the definition of a DataType.


Reference:

UML 2.x Superstructure Specification: Sections on Classifiers and DataTypes provide definitions of what constitutes a DataType and what features they can have. They specifically mention that DataTypes are kinds of classifiers that do not have identity and are often used to type attributes.

UML 2.x Infrastructure Specification: This foundational document gives additional context on the semantics of different types of classifiers, including DataTypes, and how they relate to other elements in a UML model.



Choose the correct answer :

Consider the following class diagram:



Which object diagram corresponds to it?

A)



B)



C)



D)

  1. Option A
  2. Option B
  3. Option C
  4. Option D

Answer(s): D

Explanation:

The question asks to identify which object diagram corresponds to the provided class diagram. In order to verify which object diagram is correct, we must look at the class diagram to understand the relationships and multiplicities between the classes, and then match these with the objects and links in the object diagrams.

The class diagram (not visible in your query but implied to be the reference for the object diagrams provided) must contain three classes, A, B, and C, with specific multiplicity relationships among them. Here's how we deduce the correct object diagram:

Multiplicity between A and C is "1..2", which means that for each instance of A there must be one or two links to instances of C.

Multiplicity between B and C is "0..2", which means that for each instance of B there are zero, one, or two links to instances of C.

Multiplicity between A and B is "0..1", which indicates that for each instance of A there can be zero or one link to an instance of B.

With these rules, we analyze the object diagrams:

Option A has one instance of A linked to two instances of C, which is correct according to the "1..2" multiplicity. However, there are two instances of B (b1 and b2) each linked to a single instance of C (c1), which violates the "0..2" multiplicity rule because it implies there should be two links from c1 to the B instances (b1 and b2) but instead, there are two separate links to the same instance of C (c1), which is not allowed.

Option B has similar issues where two instances of A (a2 and a1) are linked to a single instance of C, which violates the "1..2" multiplicity rule.

Option C shows each instance of A and B linked to their own separate instances of C. This violates the "1..2" multiplicity between A and C since there is only one link from A to C and does not show the possibility of two links which the multiplicity "1..2" would allow.

Option D shows a single instance of A linked to two instances of C (c1 and c2), which satisfies the "1..2" multiplicity. Additionally, there is a single instance of B linked to one of the instances of C (c1), satisfying the "0..2" multiplicity. The A instance has no direct link to the B instance, which is allowed because the "0..1" multiplicity permits zero links between instances of A and B.

Based on this analysis, the only object diagram that satisfies all the multiplicity constraints of the class diagram is Option D.

The verification of the answer can be cross-checked with the UML 2 Foundation documentation, specifically in the section dealing with object diagrams and their correlation with class diagrams, which will confirm that object diagrams represent instances of classes and must comply with the multiplicities defined in the class diagram they are derived from. Multiplicity notation and interpretation are fundamental concepts in UML and are well documented in the UML specification by the Object Management Group (OMG).



Choose the correct answer :

Consider the following diagram:



Which statement is always true about this diagram?

  1. There are infinitely many H objects inside Pckg.
  2. There are between 1 and 5 G objects inside Pckg
  3. For every H object, there are fewer than 5 G objects associated with it.
  4. There may be an G object which has no H object associated with it through gh.

Answer(s): D

Explanation:

The diagram shows a package Pckg that includes two classes G and H with a one-to-many association between them. The multiplicity '1..5' near class G on the 'gh' association end suggests that for each H object, there should be between 1 to 5 associated G objects. However, the '*' (multiplicity many) near class H on the 'gh' association end indicates that a G object can be associated with zero or more H objects. This implies that it's possible to have a G object that is not associated with any H object.


Reference:

UML 2.x Superstructure Specification: Multiplicity notations and association rules are clearly defined in the UML specifications, which detail the semantics of multiplicities and their implications for object association.

UML 2.x Infrastructure Specification: Further explains the basic constructs of the UML metamodel, which underpin the interpretation of multiplicities in associations.



Choose the correct answer :

In your model, you need to represent accounts.

Which statement supports using a Class, rather than a DataType. lor this purpose''

  1. The account is uniquely identified by its account number.
  2. The account number can change, but it would still be the same account.
  3. The account needs operations to transfer money into it or to withdraw money
  4. The account has attributes typed by Classes like account_holder; Person or bank_in_Charge Company

Answer(s): C

Explanation:

In UML, a Class is a template that defines the structure and behavior of objects, whereas a DataType is a type of classifier which specifies a domain of values without identity. Operations (such as money transfers and withdrawals) are behaviors that change the state of an object and, therefore, are defined in Classes rather than DataTypes. This suggests that accounts, which require operations to transfer and withdraw money, should be modeled as Classes.


Reference:

UML 2.x Superstructure Specification: Provides definitions for Classes and DataTypes, and details the circumstances under which each should be used. It specifically states that Classes can have operations while DataTypes cannot.

UML 2.x Infrastructure Specification: This foundational document provides an in-depth explanation of UML modeling constructs, supporting the use of Classes when operations are needed to manage an object's state.



Viewing page 7 of 19
Viewing questions 31 - 35 out of 90 questions


Post your Comments and Discuss OMG OMG-OCUP2-FOUND100 exam prep with other Community members:

AI Tutor AI Tutor 👋 I’m here to help!