Question: *************************************************************************************** CODE IN JAVA *************************************************************************************** PLEASE POST OUTPUT AS WELL *************************************************************************************** Task 2: Create a superclass named Publication that contains the following information: Attributes :

 *************************************************************************************** CODE IN JAVA *************************************************************************************** PLEASE POST OUTPUT AS WELL ***************************************************************************************

***************************************************************************************

CODE IN JAVA

***************************************************************************************

PLEASE POST OUTPUT AS WELL

***************************************************************************************

Task 2: Create a superclass named Publication that contains the following information: Attributes : String id String title double price //publication id //publication title 1/publication price Methods: public Publication (int, String, double); public String getID(); public String getTitle(); public double getPrice (); public void dispPublication(); a) Complete the Publication class definition above. b) Create a new class Book that inherits from Publication class and has new attributes number of pages and price per page. Book has a method named calcPricel) that will calculate and return the total cost of publication for the book. (total cost = number of pages * price per page * price of publication) c) Write Java application named BookApp to do the following: i. Declare a Book array and the size is entered by user ii. Input the book data and store in the array iii. Find the average cost of all book objects input into an array. iv. Count how many books that has total cost more than RM2,000 V. Display the publication information based on the ID entered by user, display an error message if ID is not found

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!