diff --git a/README.md b/README.md index df6e3ea..c0b5992 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,7 @@ -# Core program week X assignment -HackYourFuture week X assignment +# Core program week 6 assignment +The week 6 assignment for the HackYourFuture Core program can be found at the following link: https://hub.hackyourfuture.nl/core-program-week-6-assignment ## Implementation Instructions -Provide clear instructions on how trainees should implement the tasks. - -### Task 1 -Instructions for Task 1 - -### Task 2 -Instructions for Task 2 - -... - +- Implement the requirements in the `reading-list-manager` folder. +- Use the existing file structure. +- You are allowed to create additional files if needed. \ No newline at end of file diff --git a/reading-list-manager/app.js b/reading-list-manager/app.js new file mode 100644 index 0000000..b0365ef --- /dev/null +++ b/reading-list-manager/app.js @@ -0,0 +1,13 @@ +// This is the entrypoint for your application. +// node app.js + +// TODO: Implement the main application logic here +// 1. Load books on startup +// 2. Display all books +// 3. Show summary statistics +// 4. Add example of filtering by genre or read/unread status +// 5. Add example of marking a book as read + +console.log('📚 MY READING LIST 📚\n'); + +// Your implementation here diff --git a/reading-list-manager/books.json b/reading-list-manager/books.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/reading-list-manager/books.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/reading-list-manager/readingList.js b/reading-list-manager/readingList.js new file mode 100644 index 0000000..84febab --- /dev/null +++ b/reading-list-manager/readingList.js @@ -0,0 +1,53 @@ +// Place here the file operation functions for loading and saving books + +function loadBooks() { + // TODO: Implement this function + // Read from books.json + // Handle missing file (create empty array) + // Handle invalid JSON (notify user, use empty array) + // Use try-catch for error handling +} + +function saveBooks(books) { + // TODO: Implement this function + // Write books array to books.json + // Use try-catch for error handling +} + +function addBook(book) { + // TODO: Implement this function +} + +function getUnreadBooks() { + // TODO: Implement this function using filter() +} + +function getBooksByGenre(genre) { + // TODO: Implement this function using filter() +} + +function markAsRead(id) { + // TODO: Implement this function using map() +} + +function getTotalBooks() { + // TODO: Implement this function using length +} + +function hasUnreadBooks() { + // TODO: Implement this function using some() +} + +function printAllBooks() { + // TODO: Implement this function + // Loop through and display with chalk + // Use green for read books, yellow for unread + // Use cyan for titles +} + +function printSummary() { + // TODO: Implement this function + // Show statistics with chalk + // Display total books, read count, unread count + // Use bold for stats +} \ No newline at end of file diff --git a/task-1/task 1 files b/task-1/task 1 files deleted file mode 100644 index e69de29..0000000 diff --git a/task-2/task 2 files b/task-2/task 2 files deleted file mode 100644 index e69de29..0000000