Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this weekly exercise, you will implement a hierarchy of classes as described and, utilizing polymorphism, objects of the classes are exercised in a client

In this weekly exercise, you will implement a hierarchy of classes as described and, utilizing polymorphism, objects of the classes are exercised in a client program

Design a class hierarchy consisting of Publication, Magazine, Book, and KidsMagazine classes as described below. A Publication has a publisher, number of pages, a price, and a title. The class should implement a toString() method that displays all of this information. This class should be abstract.

A Magazine is a kind of publication that has a publication unit (monthly, weekly, biweekly). Magazine should have toString() that display all the information.

A Book is a kind of publication that has an author. Book should also have toString().

A KidsMagazine is a kind of magazine that has a recommended age range. Again, KidsMagazine should have toString().

Implement a client class that stores 8 different types of publications: magazine, book, or kids magazine in an array of Publication. Exploit polymorphism and print the information about each object stored in the array.

To submit this weekly exercise, gather all *.java source-code files that have been created for the above classes (in Eclipse, you can find these files in src folder under the folder that has been created for this Java project), place them in a folder, zip/compress and attach the folder.

i Adopted from: https://www.engage-csedu.org/find-resources/assignment-4 and https://www.engagecsedu.org/

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_2

Step: 3

blur-text-image_3

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

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions