Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Library

Step-by-Step

  1. Define a Book Case Class: Define a case class to represent a book with attributes like title, author, year of publication, and category.

  2. Create a List of Books: Create an initial list of books.

  3. Add a Book to the Library: Define a function to add a book to the library.

  4. Search for Books by Title or Author: Define a function to search for books by title or author.

  5. Filter Books by Category: Define a function to filter books by category.

  6. Calculate Statistics: Define functions to calculate statistics like the total number of books and the average publication year.