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, 22.06.2019 17:30
Working on this program in python 3.7: a year in the modern gregorian calendar consists of 365 days. in reality, the earth takes longer to rotate around the sun. to account for the difference in time, every 4 years, a leap year takes place. a leap year is when a year has 366 days: an extra day, february 29th. the requirements for a given year to be a leap year are: 1) the year must be divisible by 42) if the year is a century year (1700, 1800, the year must be evenly divisible by 400some example leap years are 1600, 1712, and 2016.write a program that takes in a year and determines whether that year is a leap year.ex: if the input is 1712, the output is: 1712 is a leap year. ex: if the input is 1913, the output is: 1913 is not a leap year. your program must define and call the function isleapyear(useryear). the function should return true if the input year is a leap year and false otherwise.
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
What season was better from fortnite?
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
How can you repin an image on your pinterest pin board a. click on the "repin" button b. click on the "add pin" button c. click on the "upload a pin" button d. click on the "save pin" button.
Answers: 2
question
Computers and Technology, 23.06.2019 13:30
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
You know the right answer?
Consider the following client class:import java. util. Collection;import java. util. Collections;imp...
Questions
question
Mathematics, 06.04.2021 01:10
Questions on the website: 13722367