Question: CSC 143 excersise In this weekly exercise, you will implement a hierarchy of classes as described and, utilizing polymorphism, objects of the classes are exercised

CSC 143 excersise

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

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!