Final answer:
To create an object-oriented program to keep track of a book, we can define a class called Book. This class will have private instance variables for the name of the book, the number of pages, and the current page.
The class should also provide methods to change the name, number of pages, and current page.
Step-by-step explanation:
To create an object-oriented program to keep track of a book, we can define a class called Book. This class will have private instance variables for the name of the book, the number of pages, and the current page.
To meet the program requirements, the class should also provide methods to change the name, number of pages, and current page. The class should have a default constructor to set initial values for these variables.
Additionally, we can create a separate class called BookDemo with a main method to allow the user to interact with the Book class and update the book's information.
To create an object-oriented program to keep track of a book, we can define a class called Book. This class will have private instance variables for the name of the book, the number of pages, and the current page.
The class should also provide methods to change the name, number of pages, and current page.