Question: Library Class Instance variables myLibrarians, an array of type Librarian. Class Constructor One parameter, of type integer, which will define the size of the myLibrarians


Library Class Instance variables myLibrarians, an array of type Librarian. Class Constructor One parameter, of type integer, which will define the size of the myLibrarians array. Methods getListOfLibrarianDetails, no parameters. Returns the array myLibrarians. addLibrarian, with parameters of type Librarian and integer. This method adds the Librarian object to the myLibrarians array at the specified location in the array. . Classes Part I: Librarian Class: Instance variables librarianID, of type int, initialized to 0. firstName, of type String, initialized to empty. lastName, of type String, initialized to empty service Section of type String, initialized to empty salary, of type double, initialized to 0.0; Note that an empty string is effectively just. Class constructor: Five parameters, in the order as listed in the Instance variable section. Those five variables should be initialized by the values passed in the constructor. Setters/Mutators set Service Section, with one parameter. Set the value of service Section to the value that was passed. Getters/Accessors getFirstName, with no parameters, that returns the value of firstName. getLastName, with no parameters, that returns the value of lastName. getService Section, with no parameters, that returns the value of serviceSection. getLibrarianID, with no parameters, that returns the value of librarianID. getSalary, with no parameters, that returns the value of salary. . Implementing composition form of association between Library object and Librarian object The Library can have many librarians and has many service sections such as 'media resources', 'kids place', 'study area' etc. A librarian works only in one service section. A service section can have many librarians. Assumption to support composition: A librarian cannot exist without the Library. Write the definition of class Library
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
