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.

Need help with this java homework. Please dont just use class Book

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

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!