Create a class named Book . The class have the following instance data members: Book name ISBN
Question:
Create a class named Book. The class have the following instance data members:
- Book name
- ISBN number
- Author name
- Publisher
- Price
The class will have two constructors. The first constructor will set values for Book name and ISBN number variables. The second constructor will set values for Author name, Publisher and Price.
Provide setter method and getter method for each instance variable so that each instance can be updated by the objects. Write update price method that will update the price to 5% if the price is below 200 otherwise to 3%
Write a display method that will display all the information of a Book.
In the Main method create an array of objects for 10 class Book and invoke the display method to show the information for each object.
N.B: There must be this keyword in the constructors and in the setter methods.
There also be the application of data hiding such that instance variables cannot be accessed from outside of the class. Now write a java program following the above conditions.