Choose the correct answer:
Suppose you are using a programming language that knows the following basic types: byte, short, and long.
Which diagram defines them:
A)

B)

C)


Answer : A
In UML, basic types like byte, short, and long are represented as DataType elements. These are typically used to specify the types of attributes, parameters, or return values of operations in a model. Option A shows three separate classes named Byte, Short, and Long, which would represent these as distinct data types within the UML model.
Option B incorrectly uses stereotypes on objects, which is not the correct UML representation for data types. Option C shows a class with attributes of different types, but it does not define these types as basic types. Option D is incorrect because it uses stereotypes on DataType elements, which is not the standard way to represent basic types in UML.
According to the UML 2.5 specification, DataTypes are a kind of classifier that specifies a domain of values without identity (section 10.5.8). DataTypes are not classes; they do not have operations and cannot have instances that maintain an identity.
Choose the correct answer:
Which diagram shows inherited properties?
A)

B)

C)

D) Inherited properties cannot be shown In a specialized class.
Answer : B
In UML, inherited properties are those attributes that are defined in a superclass and inherited by a subclass. According to UML notation, when a subclass inherits from a superclass, it inherits all the attributes and operations of the superclass unless they are redefined.
Let's examine each option:
A . In Option A, the Customer class shows the attributes name and address repeated from the Person class. This is not necessary in UML to show inheritance and could imply these are different attributes that happen to have the same name.
B . In Option B, the attributes of the Person class are not shown in the Customer class. This is correct as UML assumes that all attributes and operations are inherited by the subclass, and there is no need to repeat them unless they are overridden or extended. In this case, the diagram shows inheritance correctly without redundant representation of inherited properties.
C . In Option C, the inherited properties name and address are explicitly marked as inherited. While it's possible to show inherited properties in this way for clarity, it's not necessary and is less common in standard UML class diagrams.
D . Statement D is incorrect because inherited properties can be shown in a specialized class, although it is not a requirement to do so for the properties to be inherited.
Based on the UML 2 Foundation specification, the correct way to depict inheritance without redundantly listing inherited attributes is shown in Option B.
Choose the correct answer:
What represents the most appropriate use of UML during software development?
Answer : D
The most appropriate use of UML during software development is to capture the essential characteristics and design decisions of a planned or existing system. UML (Unified Modeling Language) is primarily utilized to visually represent the architecture, design, and behavior of a system, which includes detailing the components, relationships, and interactions within the system. This makes it a critical tool for understanding complex systems and making informed design decisions that align with project requirements and constraints. UML facilitates clear communication among development team members and stakeholders, ensuring that design decisions are well-understood and accurately implemented.
Choose the correct answer:

Which elements in the diagram are Features of the Car class?
Answer : D
In UML, the features of a class are the combined set of attributes (properties) and operations (methods) that are defined for that class. A feature is a characteristic that classifiers (like classes) can possess. In the context of UML, operations are considered behavioral features, while attributes are considered structural features.
Let's analyze the given options in the context of the Car class:
A . 'drive()' is an operation (method) of the Car class, but 'Car' itself is the name of the class, not a feature.
B . 'stop()' is an operation of the Car class, but 'driver' is a role name for an association, not a feature of the Car class.
C . 'name' is an attribute of the Person class, not the Car class. 'stop()' is indeed an operation of the Car class.
D . 'drive()' and 'stop()' are operations of the Car class. 'Person' is not a feature of the Car class, but no attributes of the Car class are shown in the diagram, and since features include both operations and attributes, the correct answer from the available options is D. It is understood that operations of a class are features, so the answer includes both operations of the Car class: 'drive()' and 'stop()'.
According to the UML 2 Foundation specification, both structural features (attributes) and behavioral features (operations) are considered features of a class, so the correct answer would be the operations 'drive()' and 'stop()' since those are the only features explicitly represented in the Car class in the diagram.
Choose the correct answer:
Which statement characterizes a valuable model?
Answer : A
A valuable model in UML and systems design is characterized by its usefulness rather than its complexity or how 'correct' it is in an engineering sense. A model's primary objective is to effectively communicate the key aspects of a system or process, and simplicity often enhances this communication by making the model easier to understand and use. The value of a model thus comes from its ability to facilitate decision-making, problem-solving, and understanding among stakeholders. This perspective aligns with the principle of Occam's Razor in modeling, which suggests that simpler solutions are preferable when all other factors are equal. In UML, a model that provides clear insights with minimal complexity is considered more valuable because it is accessible to a wider audience and can be more readily applied to solve real-world problems.
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''
Answer : C
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.
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.
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