Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java programming Do the same question with List Array Write a method named lowest_salary , that will get a TREE MAP array of objects (named

Java programming Do the same question with List Array

Write a method named lowest_salary, that will get a TREE MAP array of objects (named workerlist) of class Worker as an argument.

Your method should find the worker who is getting lowest salary in that array, and should return the details of the worker as an object of class Worker to the back.

Solution:

public static Worker lowest_salary (Map workerlist) {

float lowsalary = 1000000; // Start with an impossibly high salary

Worker worker, lowsalworker=null;

for (Map.Entry entry: workerlist.entrySet()) {

worker = entry.getValue(); // getting the current object from MAP

if (worker.get_wosalary()

lowsalary = worker.get_wosalary();

lowsalworker=worker;

}

}

return lowsalworker;

}

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions