EXERCISE: 1. Create a class named Book that contains data fields for the title and number of pages. Include get and set methods for these fields. Next, create a subclass named Textbook and additional methods to get and set the grade level field. Write an application that demonstrates using objects of each class. Save the files as Book.java, Textbook.java and Demobook.java 2. Create a class named Square that contains data fields for height, width and surfaceArea, and a method named computeSurfaceArea(). Create a child class named Cube. Cube contains an additional data field named depth, and a computeSurfaceArea() method that overrides the parent method. Write an application that instantiates a Square object and a Cube object and display the surface areas of the objects. Save files as Cube.java, Square. Java and DemoSquare.java
Attachments: