Question: 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

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 hierarehy consisting of Publication, Magazine, Book, and Kids Magazine 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 kid's magazine in an array of Publication. Exploit polymorphism and print the information about each object stored in the array

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!