Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this assignment, you will implement a set of related cdasses of objects: .Book: A book with a title, author and year Holding: A holding

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
In this assignment, you will implement a set of related cdasses of objects: .Book: A book with a title, author and year Holding: A holding of a particular book that includes the information on the book and its current availability Library: A collection of books that can be checked-in, checked-out, searched, etc. Keep all of your methods short and simple. In a properly-written object-oriented program, the work is distributed among many small methods, which call each other. There are no methods in this entire assignment that should require more than 10 lines of code, not counting comments, blank lines, or lines (and many of them need no more than 3). Unless specified otherwise, all instance variables must be private, and all methods should be public. Also unless specified otherwise, there should be no printin statements in your classes. Objects usually do not print anything, they only return String values from toString methods. (The findCopies method in the Book class is an exception.) Phase 1: Books First, implement the Book class, which should have: . Three instances variables: the book's title (a String), the author's name (a String) and the year it was .A constructor that has three parameters, in the above order, which are used to initialize the three instance .A standard tostring method which returns a String containing the title, author and publication year, . An equals method that checks if two books are equal. Two books are equal if they have the same title, author published (an int) variables separated by commas, as shown below. and year You can test your classes using the supplied test program TestPhase1.java. You should get the output shown below Created three book instances: Book1: To kill a Nockingbird, Harper Lee, 1960 Book2: The Lion, the witch and the wardrobe, c.s. Lewis, 195e Book3: To kill a Mockingbird, Harper Lee, 1960 Are book1 and book2 equal? false Are booki and book3 equal? true

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

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

2. Discuss the steps in preparing a manager to go overseas.

Answered: 1 week ago