Question: Need help with this java homework. Please dont just use class Book or Encyclpedia. Use Inheritance please. Like public class Encyclopedia extends Book; Thank you
Need help with this java homework. Please dont just use class Book or Encyclpedia. Use Inheritance please. Like public class Encyclopedia extends Book; Thank you so much, need this ASAP.

Exercise 2 Implement the following UML diagram. Book* numPages : int + Book (): + setPages (p : int) : void + getPages :int Encyclopedia* - numTopics: int.o Encyclopedia (p: int, t : int) + setTopics ( n : int) : void- + getTopics ) : int +computeTopicsPerPage ) : double The constructor in the Encyclopedia (this is a paper version of Wikipedia; you can read about them on Wikipedia) class sets the number of pages and number of topics. The method computeTopicsPerPage returns the average number of topics per page. Test your classes appropriately with at least two different instances
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
