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
Is there such a thing as an ethical reason for unauthorized access into a computer system?
Anastaziya [24]
Of course there is. On a simple level, consider a parent trying to locate their missing child. Someone might break into their social media accounts to see if there are messages that might help determine their whereabouts.

Consider a website hosting inappropriate pictures of children. Breaking into the server hosting the files and removing them is 100% ethical. 

I'm sure you can think of more examples. 
7 0
3 years ago
If you think a query is misspelled, which of the following should you do?
MrMuchimi

Answer:

Check the explanation

Explanation:

When there are situations of obviously misspelled queries, you will have to base the Needs Met rating on the user intent

The reason is that, even when query is misspelled it won’t mean that it is less important. Therefore, the queries should be assigned degree of rating based on the respective priority.

8 0
3 years ago
Which of the given original work is protected by the copyright law
andreyandreev [35.5K]
BMW is my desion u cant copy write alot of things like books movies logos
7 0
3 years ago
Read 2 more answers
How does outlets generate electricity???
dimaraw [331]

Answer:

"a hole is connected to the wire that brings the electricity back to the breaker box. when you turn on a lamp, the hot part of the outlet allows electricity to flow" I got this info from Google.com

Explanation:

4 0
3 years ago
How do i cancel my brainly premium account?
Vikki [24]

Answer:

press cancel

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • The _____ establishes that the destination device is present on the network, verifies active service, and informs the destinatio
    13·1 answer
  • What is the name of the option in most presentation applications with which you can modify slide elements?
    14·1 answer
  • students at a camp can choose between boating and fishing in the morning and between hiking and horseback riding in the afternoo
    11·1 answer
  • To edit the color of the text in presentation software, choose the Font color command Text Color in the ________ ribbon toolbar.
    15·2 answers
  • Hurry im TIMED
    8·1 answer
  • 1.An algorithm used to find a value in an array is called a ______________.
    7·2 answers
  • Some programmers include scroll bars, title bars, buttons, and menus in a program simply by adding them to a layout through a pr
    10·1 answer
  • Computer Graphics:
    13·1 answer
  • You have an application that renders videos for your online business. You want to make sure that the application continues to re
    8·1 answer
  • before you start researching fleet management software, your first task is to clearly define the problem. this will help guide y
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!