Question: a. The class has three fields name(String),address (String), and books(Array of Book objects). b. Create a constructor that accepts 2 paratemeters (name, and address). Also,

a. The class has three fields name(String),address (String), and books(Array of Book
objects).
b. Create a constructor that accepts 2 paratemeters (name, and address). Also, in this
constructor create the books array.
Write 2 accessor methods to return the values of name and address attributes.
d. Write 2 setter methods to change the value of name and address attributes.
e. Build toString() method to return string representation of the fileds name and address.
 a. The class has three fields name(String),address (String), and books(Array of

Write a java program to de the following programs: Library class a. The class has three fields name(String)address (String), and books(Array of Book objects). b. Create a constructor that accepts 2 paratemeters (name, and address). Also, in this constructor create the books array. c. Write 2 accessor methods to return the values of name and address attributes. d. Write 2 setter methods to change the value of name and address attributes. e. Build tostringl) method to return string representation of the fileds name and address. Beok class f. The class has three fields name(Stringh, pagesNo(int), and ChaptersNo(int). g. Create a constructor that accepts 3 paratemeters (name, pagesNo, and ChaptersNo). h. Write 3 accessor methods to return the values of name, pagesNo. and ChaptersNo.attributes. i. Write 3 setter methods to change the value of name, pagesNo. and ChaptersNo.attributes. j. Build toStringl) method to return string representation of all the objects' fileds. k. Write CheckPagesNo( ) that checks the PagesNo of the book object. If the PagesNo >500, then print the following " This book is huge". Main merthod 1. Create 2 library obyects 11 and 12, add them in an array named Libraries, Using for loop. m. Create 4 book objects b1,b2, b3 and b4, using the constructor with 3 parameters. n. Add the book objects b1 and b2 in the books array in in object, and Add the book objects b3 and b4 in the books array in 12 object. o. Use for loop to set the values of the fields (name, address) of I1 and I2, using the setter methods you bult previousely. p. Use for loop to set the values of fields (name, pagesNo, and ChaptersNo) of the b1, b2, b3 and b4 objects, using the setter methods you built previousely. q. Use for loop to check the pagesNo of all book objects stored in the Libraries array, based on the CheckPagesNo[ method created above. And print the results. r. ALSO, use for loop to print the values of all library' objects (11 and 12) filedsiname

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!