Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions