Areeba
Areeba
Khurrianwala
Assignment
Phase 1: Analysis
• Identify Problem Domain: Define the problem and its boundaries.
• Gather Requirements: Collect functional and non-functional requirements.
• Develop Use Cases: Describe system interactions.
• Create Conceptual Model: Identify key concepts and relationships.
Phase 2: Design
• Develop Class Diagrams: Visualize classes and relationships.
• Identify Classes and Objects: Define classes and objects.
• Define Attributes and Methods: Specify data and behavior.
• Establish Relationships: Define inheritance, composition, and associations.
Phase 3: Implementation
• Choose Programming Language: Select an OO language.
• Write Class Definitions: Implement classes and objects.
• Implement Methods: Code behavior.
• Test and Debug: Verify correctness.
1. Create accounts
2. Deposit funds
3. Withdraw funds
4. Check account balance
Requirements:
• Use object-oriented design principles (encapsulation, inheritance,
polymorphism)
• Identify and create necessary classes and objects
• Define attributes and methods for each class
• Establish relationships between classes
• Provide a simple user interface (console-based)
Deliverables:
• Class diagram (UML)
• Object diagram (UML)
• Source code (Java, C++, or Python)
• Written report (design decisions, explanations)
Design Guidelines:
• Separate concerns (use separate classes for account, customer, transaction)
• Use inheritance for shared attributes and methods
• Encapsulate data and behavior
• Use polymorphism for transaction types (deposit, withdrawal)
• Consider scalability and maintainability
Additional Requirements:
• Validate user input
• Handle errors and exceptions
• Provide basic security measures (password protection)
Submission:
Please submit your design documents (class diagram, object diagram), source code,
and written report as separate files.
Problem:
Design a system to manage students and courses.
2. Abstraction:
Abstraction is the practice of showing only the necessary information to the outside
world while hiding the background details or implementation.
- Example: The classes abstract the complexity of the library management system,
exposing only necessary information.
3. Inheritance:
Inheritance allows one class to inherit the properties and behavior of another class.
- Example: Not used in this example, but could be applied if we had different types
of books (e.g., fiction, non-fiction).
4. Polymorphism:
Polymorphism is the ability of an object to take on multiple forms.
- Example: Demonstrated through function overloading (e.g., search Book).
5. Composition:
Composition is a design pattern that allows objects to contain other objects.
SOLID Principles
1. Single Responsibility Principle (SRP)
A class should have only one reason to change.
- Benefits: Easier maintenance, reduced coupling.
- Example: Separate logging and calculation responsibilities.
C++ Concepts:
1. Classes and Objects: Define custom data types.
- Example: Book, Member, Library classes.
2. Constructors: Initialize objects.
- Example: Book constructor initializes title, author, and ISBN.
3. Member Functions: Perform operations on objects.
- Example: Book class has borrowed and return Book methods.
4. Vectors: Store collections of objects.
- Example: Library class uses vectors to store books and members.