Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions 2.3_Association.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,22 @@ Books by Author "Jane Doe":
Title: "Data Structures and Algorithms", Year: 2018
```

**Task 2: Book Borrowing System**
---

Enhance the `Library` class to include a book borrowing system. Add the following methods:
## Task 2: Book Availability Check

- `borrowBook(String title)`: This method should simulate a book being borrowed. It should remove the book from the library's collection if available.
Enhance the `Library` class by adding a method to check the availability of a specific book by its title.

- `returnBook(Book book)`: This method should simulate a book being returned to the library. It should add the book back to the library's collection.
- `isBookAvailable(String title)`: This method should return a `boolean` indicating whether the book with the specified title is available in the library.

**Task 3: Book Availability Check**
---

Add a method to the `Library` class to check the availability of a specific book by its title:
## Task 3: Book Borrowing System

- `isBookAvailable(String title)`: This method should return a boolean indicating whether the book with the specified title is available in the library.
Further enhance the `Library` class to include a book borrowing system.

- `borrowBook(String title)`: This method should simulate a book being borrowed. It should remove the book from the library's collection if it is available. **(Hint: You can use your `isBookAvailable` method from Task 2 to check this first!)**
- `returnBook(Book book)`: This method should simulate a book being returned. It should add the book back to the library's collection.

**Task 4: Book Ratings and Reviews**

Expand Down