1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
sergey [27]
3 years ago
6

Write a public static method called getPIDs that has a parameter of type Map called nameToPID (keys are student names and values

are student PIDs). It should return a HashSet containing all PIDs in nameToPID.
Computers and Technology
1 answer:
Rasek [7]3 years ago
4 0

Answer:

Java program is explained below

Explanation:

import java.util.HashSet;

import java.util.Map;

import java.util.TreeMap;

public class TruckRace1 {

   public static HashSet<String> getPIDs (Map<String,String>nameToPID ){

       HashSet<String> pidSet = new HashSet<>();

       for(String ids: nameToPID.values()){

           pidSet.add(ids);

       }

       return pidSet;

   }

   public static void main(String[] args) {

       Map<String,String> pids = new TreeMap<>();

       pids.put("John","123");

       pids.put("Jason","124");

       pids.put("Peter","125");

       pids.put("Alice","126");

       pids.put("Peny","129");

       HashSet<String> ids = getPIDs(pids);

       for(String id:ids){

           System.out.println(id);

       }

   }

}

You might be interested in
You are manually configuring a tcp/ip host. another administrator gives you the router's ip address. what is the tcp/ip term for
Nuetrik [128]
Answer: Default Gateway address
5 0
4 years ago
Read 2 more answers
A developer is creating an enhancement to an application that will allow people to be related to their employer. Which data mode
vredina [299]

Answer:

B. Create a lookup relationship to indicate that a person has an employer

Explanation:

Programmers are professional who build computer softwares.

Creating a lookup relationship to indicate that a person has an employer is the data model used to track the data of a developer creating an enhancement to an application that will allow people to be related to their employer. This data model allows for 25people per object.

5 0
3 years ago
How do we store value in a variable? Give an example
Komok [63]

Answer:

hi

Explanation:

im not smart

4 0
3 years ago
Websites can have good content for a particular set of search phrases, yet rank poorly. Issues that may cause this to occur incl
raketka [301]

Answer:

B. deep organizational structure

Explanation:

A website with a deep organizational structure is a positive attribute that improves site performance.

5 0
3 years ago
This is a quick and easy program that will let you practice the basics of the switch statement. You will ask the user to enter a
Nikolay [14]

Answer:

Explanation:

oof okay

5 0
3 years ago
Other questions:
  • A computer program that senses when another computer is attempting to scan or access a computer or network is called an
    7·1 answer
  • In the beginning of a presentation, it is important to:
    9·1 answer
  • Human factors is the study of:
    5·1 answer
  • Which of the following are tasks you can
    12·2 answers
  • How many of the colonists of Jamestown died before they made it to shore, due to the difficult voyage?
    15·1 answer
  • Please help me. Adnan also wants to add a photograph of a bridge. It is on another PowerPoint presentation that is open in a dif
    11·1 answer
  • Which option ensures that items in a text box or table cell will be in the absolute center of that element?
    12·1 answer
  • How can you prevent someone with access to a mobile phone from circumventing access controls for the entire device
    5·1 answer
  • PLEASE HELP! I accidently looked up a link, and now this same link keeps popping up everywhere, how do I stop this!?!? please he
    13·2 answers
  • 30 POINTS FOR THE CORRECT ANSWERS
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!