Question: Below is the holding class The Library class should have Instance variables that will allow a list of Holding objects to be stored. Use a
The Library class should have Instance variables that will allow a list of Holding objects to be stored. Use a simple partially-full array to do this. You may assume that the list will never become full-no error checking is needed. .AString instance variable to hold the name of the library .Provide an accessor method String getName() which will return the library's name. .A constructor that takes the library's name, and the maximum number of holdings An instance method void newAcquisition(Book) that creates and adds a new Holding to the list. Page 2 of 5 ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2018 .An instance method String tostring() which returns a multi-line String. The first line should give the . Aprivate instance "helper" method Holding getAvailable (Book) that returns the first Holding in the .A private instance "helper" method int findHolding(int) that returns the position of the Holding in name of the library, and subsequent lines should list all current holdings. (See the example output below.) partially filled array which is an available copy of the given book, or null if no available copies are found. the partially filled array which matches the given ID number, or NOT FOUND if no such ID number was found. Define a suitable NOT_FOUND constant. Make this constant public and static for use outside the class. .An instance method int borrowBook(Book) that finds the first Holding of that Book that is currently available and marks it as checked out. It should return the holding's ID number if an available copy was found. If no available copy was found, it should return NOT_FOUND and do nothing else. .An instance method boolean returnBook(int) that will find the Holding that matches the given ID number, and mark it as now available. It should return true if the correct Holding was found. If not, it should return false and do nothing else. An instance method int getNumberAvailable (Book)that returns the number of available holdings of a particular Book. You can test your class with TestPhase3 java. You should get the output shown below Library Pembina Trails: To Kill a Mockingbird, Harper Lee, 1960, copy 20180001: Available The Lion, the witch and the wardrobe. C.s. Lewis. 195e. coov 8182902vailahla The Library class should have Instance variables that will allow a list of Holding objects to be stored. Use a simple partially-full array to do this. You may assume that the list will never become full-no error checking is needed. .AString instance variable to hold the name of the library .Provide an accessor method String getName() which will return the library's name. .A constructor that takes the library's name, and the maximum number of holdings An instance method void newAcquisition(Book) that creates and adds a new Holding to the list. Page 2 of 5 ASSIGNMENT 1: Introduction to Object-Oriented Programming COMP 1020 Winter 2018 .An instance method String tostring() which returns a multi-line String. The first line should give the . Aprivate instance "helper" method Holding getAvailable (Book) that returns the first Holding in the .A private instance "helper" method int findHolding(int) that returns the position of the Holding in name of the library, and subsequent lines should list all current holdings. (See the example output below.) partially filled array which is an available copy of the given book, or null if no available copies are found. the partially filled array which matches the given ID number, or NOT FOUND if no such ID number was found. Define a suitable NOT_FOUND constant. Make this constant public and static for use outside the class. .An instance method int borrowBook(Book) that finds the first Holding of that Book that is currently available and marks it as checked out. It should return the holding's ID number if an available copy was found. If no available copy was found, it should return NOT_FOUND and do nothing else. .An instance method boolean returnBook(int) that will find the Holding that matches the given ID number, and mark it as now available. It should return true if the correct Holding was found. If not, it should return false and do nothing else. An instance method int getNumberAvailable (Book)that returns the number of available holdings of a particular Book. You can test your class with TestPhase3 java. You should get the output shown below Library Pembina Trails: To Kill a Mockingbird, Harper Lee, 1960, copy 20180001: Available The Lion, the witch and the wardrobe. C.s. Lewis. 195e. coov 8182902vailahla
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
