OMG-OCUP2-FOUND100 OMG Certified UML Professional 2 (OCUP 2) - Foundation Level Exam Practice Test

Page: 1 / 14
Total 90 questions
Question 1

Choose the correct answer:

The stale machine below is in state1:

When does it transition to state2?



Answer : C

The image depicts a state machine with three states labeled 'state1' and 'state2'. Three events, e1, e2, and e3, are shown triggering transitions.

Analyzing the diagram, we can observe that all three events (e1, e2, and e3) are required for the transition from state1 to state2. The events are arranged sequentially, implying a specific order for the transition to occur.

Here's a breakdown of the reasoning for excluding other options:

Option A (When all of el. e2. and e3 occur in any order) is incorrect because the order of events matters.

Option B (When any one of the events e1. e2. or e3 occurs) is incorrect because all three events are necessary for the transition.

Option D (Never, because a transition cannot have more than one trigger) is incorrect because the state machine can transition with multiple triggers, but in this specific case, the order is crucial.

Therefore, based on the visual representation of the state machine, the correct answer is that the transition to state2 happens only when events e1, e2, and e3 occur in precisely the specified order


Question 2

Choose the correct answer:

Which diagram is invalid?

A)

B)

C)

D)



Answer : C

Option C shows a UML diagram where a class (One) appears to have an aggregation relationship with itself. In UML, an aggregation is a special type of association that represents a whole-part relationship between the aggregate (whole) and a component part. However, it does not make sense for a class to aggregate itself; such a relationship implies that instances of the same class are parts of each other, which is conceptually invalid.

Let's consider the other options: A) This diagram shows a class contained within another, which is a valid use of nesting classes. B) This diagram shows a composition relationship, which is a form of aggregation with a stronger lifecycle dependency between the whole and the part. This is a valid relationship in UML. D) This diagram shows a class containing two nested classes, one of which contains another nested class. This is also a valid representation of nested classes in UML.

Therefore, the correct answer is:

C . Option C


Question 3

Choose the correct answer:

Consider the following diagram fragment:

What makes this fragment invalid?



Answer : F

In the given UML package diagram fragment, various elements are listed with stereotypes indicating their nature (class, interface). Stereotypes are used in UML to extend the vocabulary of UML in order to create new kinds of building blocks. They are typically enclosed in guillemets ( ).

The last element, 'six', does not have a stereotype indicating whether it's a class, interface, or some other kind of element. This lack of a stereotype leads to ambiguity about the nature of 'six'. Therefore, the fragment is considered invalid due to this omission.

All the other options do not constitute an error in the UML fragment: A) A list of elements is allowed in a package body. B) Visibility is not required for every element, especially within package diagrams. C) Interfaces are allowed in packages. D) Private elements are allowed in a package. E) Protected elements are also allowed in a package.

Therefore, the correct answer is:

F . Element six is missing its stereotype.


Question 4

Choose the correct answer:

Which statement is correct regarding the diagram below?



Answer : C

The dashed arrow with an open arrowhead in the UML diagram represents a dependency relationship. In UML, a dependency is a relationship that signifies that one element, or set of elements, requires another element (or set of elements) for its specification or implementation. This means that changes to the target element(s) (the element(s) that the arrow points to) may cause changes to the source element(s).

The statement 'One or more of the elements in Package G depends on one or more of the elements in Package F' correctly describes the nature of a dependency relationship in UML. It indicates that there is at least one element in Package G that requires some element(s) from Package F. This does not necessarily imply that all elements from Package G depend on all elements from Package F.

Therefore, the correct answer is:

C . One or more of the elements in Package G depends on one or more of the elements in Package F.


Question 5

Choose the correct answer:

How would you refer lo element One of Package PI. when inside Package P2?



Answer : D

In UML, when you need to reference an element from another package while inside a different package, you use the qualified name. A qualified name includes the package name followed by two colons and then the element name. This ensures that the reference is clear and unambiguous, especially when different packages may have elements with the same name.

The correct syntax for referring to element One of Package P1 from inside Package P2 is P1::One, where :: is the scope resolution operator used to separate the package name from the element name.

Therefore, the correct answer is:

D . P1::One


Question 6

Choose the correct answer:

Consider the following class definition:

Which diagram fragment shows an instance of the Company class in which name has the value OMG?

A)

B)

C)

D)

E)

F)



Answer : D

To represent an instance of a class in a UML Object Diagram, the standard notation is to specify the instance name followed by a colon and the class name, and then list the attribute values within the compartment.

The class definition for Company specifies that there is one attribute, name, of type String.

An instance of Company where the name attribute has the value 'OMG' would be shown as follows:

InstanceName : ClassName attributeName = attributeValue

In the provided options, Option D correctly represents an instance of the Company class with the name attribute set to 'OMG'. The name of the instance is not specified, which is allowed in UML when the instance name is not important or is understood from the context.

Thus, the correct answer is:

D . Option D


Question 7

Choose the correct answer:

How many class instances can be shown on an Object Diagram?



Answer : D

In UML, an Object Diagram is a type of static structure diagram that shows a snapshot of the detailed state of a system at a point in time. It focuses on some particular set of objects and attributes, and the links between them. When it comes to the number of instances that can be represented in an Object Diagram, it can range from zero (in cases where the diagram is used to show that no instances of a class exist under certain conditions) to many instances. Therefore, an Object Diagram can show 0 instances, 1 instance, or many instances, which is represented by the multiplicity notation 0..*.

Therefore, the correct answer is:

D . 0..*


Page:    1 / 14   
Total 90 questions