Question: - A constructor that receives as input the name and location. Getters for each attribute. add_book(title: String, author: String): Bool -- This operation adds the

 - A constructor that receives as input the name and location.

- A constructor that receives as input the name and location. Getters for each attribute. add_book(title: String, author: String): Bool -- This operation adds the book's title to the list of books and the author to the list of authors. The method must confirm before adding that both attributes are of type String, otherwise the operation won't be performed. The method must return True if the book and author were added, False otherwise _str_() -- Should return the following information "Name: ; Location: ; Books: ". Check the testcase for details. remove_book(title: String): Bool -- If the book is in the book's list then it must be removed together with its corresponding author from the author's list (and return True). Otherwise it should return False. add_from_file(filename: String) -- Reads the books' titles and authors from a text file and adds them to the corresponding lists. The file has one book- author per line separated by a semicolon and an arbitrary number of spaces (i.e. the author name could have preceding spaces). You can assume the filename passed as parameter does exist (i.e. you do not need to check if a file exists). For example: Test Result High Park Toronto # Testing constructor and name and location getters Library - Library ("High Park Library", "Toronto") print(Library.get_name()) print (Library.get_location() # Testing add_book method Library - Library("High Park Library", "Toronto" True Lord of Talk

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!