Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 2: BoOK PROGRAM Design and write a java class that represents books. Use good Object Oriented Programming structure and style. Test your program by
QUESTION 2: BoOK PROGRAM Design and write a java class that represents books. Use good Object Oriented Programming structure and style. Test your program by creating a separate class with a main program that creates, Your Book class must provide the following capabilities using good encapsulation techniques, 1. Books have a title (String), author (String), publication year (int), and total number of updates, and prints out some Book objects. good style, and good Object Oriented Programming pages (int). Books also have a current reading position (the page where you are in the book currently) 2. Books can be constructed in two ways A new book is created with title, author, publication year, and total number of a. pages (set the reading position to page 1) b. A new book is alternatively created with the all the information as above but also with a current reading position. Be sure the current reading position is not beyond the end of the book. (in both cases be sure the object is fully set up in a consistent way and ready to be used) 3. Provide a method called updatePage that allows users of the class to update the current reading position to a new page. Be sure the reading position does not go beyond the end of the book. Be sure you allow the reading position to go backwards (to show will reread from some point)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started