#K77247. Book Club Manager
Book Club Manager
Book Club Manager
You are required to implement a system to manage a book club's collection. The system supports adding books and finding books by a specific author. A book is defined by its title and the author's name. The books should be stored in the order they are added.
The operations supported are as follows:
- ADD: Add a new book to the collection. The book information includes the title and the author.
- FIND: Given an author's name, output all books by that author in the order they were added, separated by a comma. If no book is found, output an empty line.
Note: The number of operations is given as the first input line. The following operations are provided one per line (with additional lines for arguments as described in the input format).
You may assume that the input is valid. The functionality required can be described by the following methods in a BookClub class: $$ \texttt{\textbf{add_book}(\,title,\,author)} $$ $$ \texttt{\textbf{find_books_by_author}(\,author)} $$
inputFormat
The first line contains an integer Q, the number of operations.
Each operation has one of the following formats:
- If the operation is ADD, then the next two lines are:
- A string representing the title of the book.
- A string representing the author of the book.
- If the operation is FIND, then the next line is a string representing the author to search for.
Input should be read from standard input (stdin).
outputFormat
For each FIND operation, output a single line containing the book titles by the given author separated by a comma (","). If no book is found, print an empty line.
Output the result to standard output (stdout).
## sample3
ADD
To Kill a Mockingbird
Harper Lee
FIND
Harper Lee
To Kill a Mockingbird