Answered step by step
Verified Expert Solution
Question
1 Approved Answer
intro to java course(please make it as easy as possible) Any help greatly appreciated 1. Define a class named Book that contains: An int data
intro to java course(please make it as easy as possible) Any help greatly appreciated
1. Define a class named Book that contains: An int data field named pages that stores the number of pages in the book. A String data field named title that represents the title of the book. A constructor that accepts and creates a book object with the specified pages and book title . The getter and setter methods for all data field. A toString method that returns book information including the book title and pages The equals method that returns true if two books have same title and same number of pages. .The compareTo method that compares two books and returns -1 if the first book has less pages than the second one, +1 if the first book has more pages second one and 0 if both books have same number of pag 2. Write an application TestBoks that asks the user for a number of books read dng summer The application repeatedly creates that many book objects and prints to the screen information about the sm aller" book, ie. the book with the smaller number of pages, as well as the average number of pages per book readStep 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