Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Just need the code to run this program in Java Kindk rmakrs have to store information about cach book that a users is reading. The
Just need the code to run this program in Java
Kindk rmakrs have to store information about cach book that a users is reading. The two main items of information are the number of pages in the book, and the current page mumber the rcader has reached. Write a class to create objects that store this information, and work with this simple driver class. Your class must have . Two integer data items for storing the page information. . A constractor that receives the number of pages in the book, and sets the current page number to I A tostring method for printing the object . A method to increase the current page number. If no argument is sent it increments the current page number. If an inleger argument is sent it increases the current page number by that amount. (Hint: Review Overloading" in the notes about Mcthods) In both cases the method must check if the increase will take the current page number past the end of the book, in which case an error message should be issued, and the current page number set to the last page. (Hi: Use the tostring method to help print the error message.) Here's what a sample run should look like (with the keyboard input shown in italics) nany pages the book Fage 1 of 3. After skipping 27 pages urning pages would take you paat the last page You must Page 33 of 3 * write the Kindle class ( 1 0%) 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