Question: Complete the following tasks: a. Design a class named Book that holds a stock number, author, title, price, and number of pages. Include methods to

Complete the following tasks:

a. Design a class named Book that holds a stock number, author, title, price, and number of pages. Include methods to set and get the values for each data field. Also include a displayInfo() method that displays each of the Book’s data fields with explanations.

b. Design a class named TextBook that is a child class of Book. Include a new data field for the grade level of the book. Override the Book class displayInfo() method to accommodate the new grade-level field.

c. Design an application that instantiates an object of each type and demonstrates all the methods.

Step by Step Solution

3.51 Rating (175 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a Diagram Book stockNum num author string title string price num numPages num setStockNumnumber num void setAuthorau string void setTitlettl string vo... View full answer

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 Programming Logic & Design Questions!