Challenge: Library Book Tracker
Swipe to start coding
Write a program to manage a library system that tracks which books are checked out and who has borrowed them. The program should allow assigning books to borrowers, returning books, and listing all currently borrowed books.
- When a book is checked out, add it to the collection with the borrower's name.
- When a book is returned, remove it from the collection.
- When listing borrowed books, return a list of strings, each showing the book title and the borrower's name.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Awesome!
Completion rate improved to 4.76
Challenge: Library Book Tracker
Swipe to show menu
Swipe to start coding
Write a program to manage a library system that tracks which books are checked out and who has borrowed them. The program should allow assigning books to borrowers, returning books, and listing all currently borrowed books.
- When a book is checked out, add it to the collection with the borrower's name.
- When a book is returned, remove it from the collection.
- When listing borrowed books, return a list of strings, each showing the book title and the borrower's name.
Solution
Thanks for your feedback!
single