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

Page: 1 / 14
Total 90 questions
Question 1

Choose the correct answer:

Consider the following diagram:

Which statement is correct according to the diagram?



Answer : D

In UML class diagrams, relationships between classes are represented in a number of different ways, including generalization, association, and composition.

Looking at the provided options, let's analyze each one:

A . responsiblePerson inherits from Person -- This is incorrect because the responsiblePerson is an attribute of the Task class, not a class itself, so it cannot inherit from Person.

B . Client and Manager have nothing in common -- This is incorrect because both Client and Manager are specialized types of Person as indicated by the generalization arrows pointing to Person.

C . responsiblePerson can not refer to an object of class Client -- This is incorrect. responsiblePerson is typed by Person, which means that it can refer to an instance of any subclass of Person, including Client.

D . The object referred to as responsiblePerson can be a Manager -- This is correct. Since responsiblePerson is an attribute of the Task class with the type Person, and Manager is a subclass of Person, responsiblePerson can indeed refer to an instance of Manager.

The correct answer is based on the UML 2 Foundation specification that describes how attributes are typed by classes and can refer to instances of these classes or their subclasses (UML 2.5 specification, sections 9.3.3 and 9.5.3). The generalization relationship (represented by a triangle followed by a line) establishes a hierarchy between a more general element and a more specific element, which in this case means that Client and Manager are both specific types of Person and can be used wherever Person is expected (UML 2.5 specification, section 9.4.5).


Question 2

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 3

Choose the correct answer:

In the context of a UML model designed to capture the elements of a real-world business enterprise, the class Employee appears in the fragment of a class diagram as shown below:

Which actual entity does this element represent?



Answer : B

In the context of a UML (Unified Modeling Language) model, the class named 'Employee' represents a template for all entities that are classified as employees within the business enterprise model. Therefore, the correct answer is:

B . The set of all employees of the company

The term 'Employee' in the class diagram is a UML Class, which is defined as a description of a set of objects that share the same attributes, operations, relationships, and semantics (UML 2.5 specification, section 9.2). A class in UML is a blueprint from which individual objects (instances of the class) are created. It is not a representation of any single employee, an anonymous employee, or a diagram of an employee, but rather the conceptual model that defines the properties and behaviors of all employee instances in the domain being modeled.


Question 4

Choose the correct answer:

Why are abstractions in a model helpful?



Answer : B

Abstractions in a model are helpful because they can express or suppress detail as needed. This capability is essential in managing complexity in a model by focusing on the high-level, essential aspects of the system while omitting or simplifying the less critical details. This selective detail management aids in understanding and analyzing the system's core functionality without getting overwhelmed by its intricacies. Abstractions facilitate clearer communication, more focused analysis, and more efficient system design by highlighting the most relevant aspects of the system in various contexts.


Question 5

Choose the correct answer: Which technique does Abstraction incorporate?



Answer : B

Abstraction in UML and software modeling often incorporates the technique of information hiding. Information hiding is a principle that supports abstraction by ensuring that unnecessary details about software components are not exposed to other parts of the system. This encapsulation strengthens modularity and keeps various parts of the program independent of one another, which simplifies complexity in large systems. Abstraction and information hiding are closely related; abstraction focuses on the high-level structure of the system, while information hiding protects the internal states and functionality of components, allowing changes without extensive impact on other system parts.


Question 6

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 7

Choose the correct answer:

Consider the following class diagram:

Which statement is true about the class diagram?



Answer : B

In UML 2, a class diagram is used to depict the structure of a system by showing the system's classes, their attributes, operations (or methods), and the relationships among the classes. The constraint {age >= 18} in the Person class diagram indicates a condition that must hold true for the instances of the Person class whenever they are used in the context of a BankAccount. This constraint is an invariant of the Person class that specifies the rule for the attribute age.

Now, let's consider the provided options and explain why option B is correct:

A . The preferred age to open a bank account is 18 years old or older -- This statement is incorrect because the diagram does not indicate a preference; it indicates a constraint or a rule.

B . Only customers who are 18 years old or older can open a bank account -- This is the correct statement. The {age >= 18} constraint next to the age attribute of the Person class signifies that any instance of Person associated with a BankAccount must be at least 18 years old. Since Person is connected to BankAccount with the role name customer, this implies that only persons who are at least 18 can be customers of a bank account.

C . The age condition should only hold when the setAge(Integer) function is called -- This statement is incorrect because the constraint {age >= 18} is not a condition that applies only when the setAge operation is invoked. Instead, it is a class invariant that must always hold true for any instance of Person.

D . An object of Customer with age set to 18 or greater will raise an exception -- This is incorrect because the UML diagram specifies a constraint, not an exception condition. The constraint ensures validity, not the raising of an exception.

The answer is verified according to the UML 2 Foundation documents, such as the UML 2.5 specification, where class diagrams and constraints are defined. The specification states that constraints are semantic conditions or restrictions expressed in natural language text or in a machine-readable language that must hold true for the system being modeled (UML 2.5 specification, section 7.9).


Page:    1 / 14   
Total 90 questions