Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedimage text in transcribed

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 setService 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 service Section. getLibrarianID, with no parameters, that returns the value of librarianlD. getSalary, with no parameters, that returns the value of salary. . 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 my Librarians. 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. Part III - TestComposition Class Methods Main only. In it, you must create four Librarian objects: 222 Becky Linpay Media 1500.00 333 Michael Steve Kids place 1400.00 444 Jose Lanman returns 1200.00 555 Your Iname Your fname Study area 1800.00 Add these four Librarian objects to a new Library object, which you have correctly initialized with the correct constructor. Retrieve the array of Librarian objects from your Library, using the getListOfLibrarianDetails method. In a for loop, iterate through the array, accessing each individual Librarian, and printing out the details to the console. Your output should look more-or-less like this: LibrarianID LastName FirstName Service Section Salary 222 333 444 555 Becky Michael Jose Your Iname Linpay Media Steve Kids place Lanman returns Your fname Study area 1500.00 1400.00 1200.00 1800.00

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

8. Why are pay-for-performance systems growing in importance?

Answered: 1 week ago

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago