Lesson 34 of 34

Mini Project: Library Management

15 min 50 XP

Let's combine everything into a small project. A library has books; students can borrow and return them. Each command arrives as one line of input, just like a real coding-round problem.

Example: edit me and press Run

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.

Put this project on your resume: push it to GitHub and grow it with due dates and fines.

Challenge

+50 XP

Run a library from commands. The first line is n, the number of commands. Each command is one of: ADD id title (title is one word) → prints nothing BORROW id → "Borrowed title", or "title is already borrowed", or "No such book id" for an unknown id RETURN id → "Returned title", or "title was not borrowed" COUNT → "Available: k"

Output Loading Java (first time takes a few seconds)
Press Run to see the result here.