You are on page 1of 2

Object Oriented Analysis & Design

Lab # 11

The objectives of lab 11 are to:


• Practice UML modelling

Exercise
Task 1: Consider the following algorithm for computing the norm of a vector. Write
down a sequence diagram that describes the norm function.

Class Array {
...
public:
// return the index-th component of the array
double get(int index);
...
};
double norm(const Array& myArray) {
double theNorm = 0;
for(int index = 0; index < myArray.size() - 1; index++) {
theNorm = theNorm + myArray.get(index);
}
theNorm = sqrt(theNorm);
return theNorm;
}
Task 2: Propose a use case diagram for an ATM machine for withdrawing cash. Make
the use case simple yet informative; only include the major features. Such as a customer
can withdraw money, transfer funds and deposit money. The administrator can check
logs and register the ATM at Bank.

Task 3: Write a sequence diagram for a program that displays the below figure on
the screen in the order left→right

Task 4: Draw a class diagram representing a singly linked list.

Composite composite
Ellipse
Triangle
Polygon

Circle

You might also like