Taking into account the previous exercise, create also the Bookcase class (understood as a bookcase inside a
Question:
Taking into account the previous exercise, create also the Bookcase class (understood as a bookcase inside a bookstore). Each bookcase must be dedicated to a certain literary genre included in the list of genres chosen in the previous exercise, and therefore must contain only books of the same genre. In the Bookcase class there must be a method called addBook (Book book), which allows you to add a book with the correct genre to the bookcase. Also create the Bookstore class. A bookstore must contain only one bookcase for each genre, and therefore it is necessary to prevent that two bookcases with the same genre can be added. Finally create a BookstoreTest class, which creates an object of type Bookstore adding to it objects of type Bookcase to which have been added objects of type Book. Verify that two bookcases with the same genre cannot be added to the bookstore.
Government and Not for Profit Accounting Concepts and Practices
ISBN: 978-1118155974
6th edition
Authors: Michael H. Granof, Saleha B. Khumawala