Assignment CA On Uml
Assignment CA On Uml
1. (5 points) Draw a class diagram showing the relationship between a Customer and an Order. A
customer can place multiple orders, and an order belongs to one customer. Include at least three
attributes for each class.
2. (5 points) Draw a use case diagram for an online banking system. Include at least four use cases (e.g.,
check balance, transfer funds, pay bills, view statements) and at least two actors (customer, bank
administrator).
3. (5 points) Draw a sequence diagram illustrating the interaction between a user, a web server, and a
database when a user logs into a website.
4. (5 points) Draw a state diagram for a simple traffic light. Include the states (red, yellow, green) and
transitions between them.
1. (10 points) Explain the difference between generalization, aggregation, and composition relationships
in UML class diagrams. Provide examples for each.
2. (10 points) Draw a class diagram for a library system. Include classes for Book, Member, Loan, and
Librarian. Show the relationships between these classes and include relevant attributes and methods.
Consider different types of members (e.g., student, faculty).
3. (5 points) What is an abstract class? How is it represented in a UML class diagram? Give an example.
3. (5 points) What is an abstract class? How is it represented in a UML class diagram? Give an example.
Section 3: Use Case Diagrams and Requirements (20 points)
1. (10 points) Describe the purpose of a use case diagram. How do use cases help in the software
development process?
2. (10 points) Develop a use case diagram for an e-commerce system, focusing on the "purchase item"
use case. Identify the actors, pre-conditions, post-conditions, and main success scenario. Include
alternative scenarios (e.g., insufficient funds, item out of stock).
1. (10 points) Explain the concept of design patterns. Name and briefly describe three common design
patterns (e.g., Singleton, Factory, Observer).
2. (10 points) What are activity diagrams used for? Draw an activity diagram showing the process of
ordering a pizza online, from selecting items to receiving the order.
3. (5 points) Briefly describe the purpose of a component diagram and a deployment diagram. When
would you use each?
1. (10 points) You are designing a software system for a university registration system. Draw a class
diagram showing the classes Student, Course, Professor, and Registration. Include attributes and
methods that are relevant to the system. Show the relationships between the classes. Consider
aspects like course prerequisites and student enrollment limits.
Section 6
Scenario: Design an online library system that allows users to search for books, borrow and return
books, manage their accounts, and receive recommendations. Librarians can add new books, manage
member accounts, and track book availability.
Questions:
• Create a class diagram for the online library system. Include at least the following classes: Member,
Book, Loan, Librarian, Admin, Search, RecommendationEngine.
• Define attributes and methods for each class. Clearly show the relationships between classes
(association, aggregation, inheritance, etc.). Use appropriate multiplicity notations. Consider different
member types (e.g., student, faculty) if applicable. Think about how you would handle different book
types (e.g., physical books, ebooks).
• Create a use case diagram showing the interactions between the actors (Member, Librarian, Admin)
and the system.
• Include at least five use cases: Search for Books, Borrow Book, Return Book, Manage Account, Add
New Book.
• Clearly identify actors and their relationships with the use cases.
• Create a sequence diagram illustrating the sequence of interactions when a member borrows a book.
Include the relevant classes from your class diagram. Show the messages passed between objects.
• Create a use case diagram showing the interactions between the actors (Member, Librarian, Admin)
and the system.
• Include at least five use cases: Search for Books, Borrow Book, Return Book, Manage Account, Add
New Book.
• Clearly identify actors and their relationships with the use cases.
• Create an activity diagram depicting the process of adding a new book to the library system by a
librarian. Include actions, decisions, and branching.
• Create a deployment diagram showing the deployment of the online library system. Include nodes
(servers, databases), components, and their connections. Consider aspects of redundancy and
scalability.
• Create a component diagram showing the major components of the online library system and their
dependencies. Identify interfaces and provided/required services. Consider components like the user
interface, the database, the search engine, and the book management module.
• Consistency: Consistency between different diagrams (e.g., class diagram and sequence diagram).
Additional Considerations:
• You may need to add additional classes or use cases to fully represent the system's functionality.
• Explain any design decisions you made and the rationale behind them.
This comprehensive application question requires a deep understanding of UML and its application in
software design. The goal is to test your ability to model a system using various UML diagrams and to
demonstrate your understanding of relationships between different diagrams. A thorough answer will
include well-drawn, clearly labeled diagrams with concise explanations where appropriate
Section 7
1. (5 points) Defining the difference: Explain the key differences between composition and
aggregation in UML class diagrams. Provide examples of real-world scenarios where each would be
appropriate. Illustrate your answer with simple class diagrams showing the relationship between the
parts and the whole.
2. (5 points) Identifying relationships: Consider a "Car" class and its components. Indicate
whether the following relationships are composition or aggregation, and justify your choice:
3. (10 points) Design Scenario: You are designing a software system for an online store. Model
the relationship between an "Order" and "OrderItem" using either composition or aggregation. Justify
your choice with a detailed explanation and a corresponding UML class diagram. Include relevant
attributes and methods. Consider aspects like deleting an order and its impact on order items.
II. Extend and Include in Use Cases:
1. (5 points) Defining Extend and Include: Explain the differences between the extend and
include relationships in UML use case diagrams. What are the scenarios where each
relationship is most suitable? Provide clear examples.
2. (5 points) Identifying the relationship: You are modeling use cases for an e-commerce
website. Determine whether the following relationships would be modeled using extend or
include, and justify your answer:
* The "Process Payment" use case is included in both "Place Order" and "Return Item" use
cases.
* The "Handle Exception" use case can extend the "Place Order" use case if a credit card is
declined.
* The "Send Confirmation Email" use case is included after a successful "Place Order" use
case.
* The "Verify User Login" use case is used before most use cases requiring user
authentication.
3. (10 points) Use Case Diagram: Draw a use case diagram for a simple online banking
system. Include at least the following use cases: "Transfer Funds," "Check Balance," "Pay
Bills," "View Transactions." Use extend and include relationships to model additional
functionalities like "Handle Insufficient Funds" (extends "Transfer Funds") and "Log
Transaction" (included in "Transfer Funds," "Pay Bills," and "View Transactions"). Clearly
label all relationships and provide brief descriptions.