subject

Consider the following client class:import java. util. Collection;import java. util. Collections;import java. util. HashMap;import java. util. Map;import java. util. Set;public class PresidentsMain { public static void main(String[] args) { Map = new HashMap(); .put("George Washington", "Unaffiliated"); .put("John Adams", "Federalist"); .put("Thomas Jefferson", "Democratic-Republican"); .put("James Madison", "Democratic-Republican"); .put("James Monroe", "Democratic-Republican"); .put("John Quincy Adams", "Democratic-Republican"); .put("Andrew Jackson", "Democratic"); .put("Martin Van Buren", "Democratic"); .put("William Henry Harrison", "Whig"); .put("John Tyler", "Whig"); } }}Extend given client class:Implement a static method called FilterMapByValue, that takes 2 parameters:Map InMap;String TargetValue;Method should print out all map elements, for which Value == TargetValue. Test the implementation by filtering map so that only presidents, affiliated with Democratic-Republican party are printed. Note: use the following to iterate over a map: for (Map. Entry Entry : InMap. entrySet()) Implement a method PrintValues, that prints all values for a given map (use map’s values() function). Test the implementation on map. Implement a method PrintKeys, that prints all keys for a given map (use map’s keySet() function). Test the implementation on map.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 12:40
According to the video what are some tasks petroleum engineers perform check all that apply
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
question
Computers and Technology, 23.06.2019 22:30
Jamie has to enter the names, employee id’s, and income of a group of employees into a worksheet. which option will jamie use to describe the data
Answers: 3
question
Computers and Technology, 24.06.2019 07:00
Why do we mark tlc plates with pencil and not with pen
Answers: 2
You know the right answer?
Consider the following client class:import java. util. Collection;import java. util. Collections;imp...
Questions
question
Mathematics, 17.10.2020 21:01
question
Social Studies, 17.10.2020 21:01
Questions on the website: 13722359