Question: You should write the codes in Java and please upload the code and screenshot of the output too. The class Book has two subclasses namely


You should write the codes in Java and please upload the code and screenshot of the output too.
The class Book has two subclasses namely EBook and PaperBook. The class PaperBook has a subclass namely Encyclopedia. A Book has an Author such that an Author can have many Books. (i) The class Book has 3 attributes namely ISBN, title and price which are of type integer, String and double respectively. The constructor of the class initialises all 3 variables. The class Book also has Set and Get methods for all 3 attributes and a method PrintDetails that displays the book details. Implement the class Book and the methods therein. [6 MARKS] (ii) The class PaperBook inherits all of the above variables and has another attribute shipping Weight which is of type double. PaperBook has a constructor that initialises ISBN, title, price and shippingWeight. The class also has an accessor and mutator method for shippingWeight and a method PrintDetails that displays the paper book details. Implement the class PaperBook and the methods therein. [4 MARKS] (iii) The class Encyclopedia inherits all the variables of the class PaperBook and has another variable edition which is of type String. Encyclopedia has a constructor that initializes ISBN, title, price and edition. The class also has methods for setting and getting the edition and a method PrintDetails that displays the encyclopedia details. Implement the class Encyclopedia. [5 MARKS] ( (iv) Build a class CreateBooks that creates an array of 3 book objects with the following information: 1 PaperBook ISBN: 14556 title: Java Programming for Experts" price: $ 50.99 shippingWeight: 0.5 kg 2 Encyclopediae ISBN: 94897 title: "Wildlife and Nature" price: $ 200.99 edition: Knowledge Series" ISBN: 23487 title: "Wonders of the Sea" price: $ 100.05 edition: "Expert Series" You should also print the details of each book stored in the array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
