Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

 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.

Step by Step Solution

3.47 Rating (147 Votes )

There are 3 Steps involved in it

Step: 1

Based on the description provided heres an implementation of the Bookcase Bookstore and BookstoreTest classes in Java java import javautilHashMap impo... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Government and Not for Profit Accounting Concepts and Practices

Authors: Michael H. Granof, Saleha B. Khumawala

6th edition

978-1-119-4958, 9781118473047, 1118155971, 1118473043, 978-1118155974

More Books

Students also viewed these Programming questions