0% found this document useful (0 votes)
23 views5 pages

OOAD LAB Exercise

The document contains multiple lab exercises focusing on different UML diagrams, including class diagrams for banking, library, and e-commerce systems, a sequence diagram for a chat application, and a state machine diagram for a traffic light. Each exercise outlines the relationships and attributes of various classes or participants involved in the respective systems. The diagrams serve as visual representations of the system structures and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views5 pages

OOAD LAB Exercise

The document contains multiple lab exercises focusing on different UML diagrams, including class diagrams for banking, library, and e-commerce systems, a sequence diagram for a chat application, and a state machine diagram for a traffic light. Each exercise outlines the relationships and attributes of various classes or participants involved in the respective systems. The diagrams serve as visual representations of the system structures and interactions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Lab Exercise 1: Class Diagram for a Simple Banking System

classDiagram
class Customer {
-name: string
-accountNumber: string
-accountType: string
}
class Account {
-accountNumber: string
-accountType: string
-balance: float
}
class Transaction {
-transactionId: string
-date: date
-amount: float
-type: string
}
Customer --* Account
Account --* Transaction

Lab Exercise 2: UML Sequence Diagram for a Chat Application


sequenceDiagram
participant User1
participant ChatServer
participant User2
User1->>User2: Send message
User2->>ChatServer: Forward message
ChatServer->>User2: Broadcast message
User2->>User1: Display message

Lab Exercise 3: Class Diagram for a Library Management System


classDiagram
class Book {
-title: string
-author: string
-isbn: string
}
class Member {
-name: string
-memberId: string
-email: string
}
class Borrowing {
-borrowingId: string
-book: Book
-member: Member
-borrowDate: date
-returnDate: date
}
Book --* Borrowing
Member --* Borrowing
Lab Exercise 4: UML State Machine Diagram for a Traffic Light
stateDiagram
state Red
state Yellow
state Green
Red --> Yellow: Timer expires
Yellow --> Green: Timer expires
Green --> Red: Timer expires
Lab Exercise 5: Class Diagram for a Simple E-commerce System**
classDiagram
class Product {
-name: string
-description: string
-price: float
}
class Customer {
-name: string
-email: string
}
class Order {
-orderId: string
-customer: Customer
-orderDate: date
-total: float
}
class OrderItem {
-orderItemId: string
-order: Order
-product: Product
-quantity: int
}
Product --* OrderItem
Customer --* Order
Order --* OrderItem

You might also like