Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed

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

Step: 1

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

Modern Database Management

Authors: Fred R. McFadden, Jeffrey Slater, Mary B. Prescott

5th Edition

0805360549, 978-0805360547

More Books

Students also viewed these Databases questions

Question

What is meant by Non-programmed decision?

Answered: 1 week ago

Question

What are the different techniques used in decision making?

Answered: 1 week ago

Question

Have roles been defined and assigned?

Answered: 1 week ago