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
Felicia's Wi-Fi connection to her phone is extremely slow. However, her
Alex Ar [27]

Answer: fake water all across the road

Explanation:

3 0
3 years ago
Read 2 more answers
Long-term memory used by the computer:
Fynjy0 [20]
The long term memory used by the computer is called “RAM”
6 0
3 years ago
Read 2 more answers
In a transaction-processing system (TPS), if the TPS database can be queried and updated while the transaction is taking place,
neonofarm [45]

Answer:

Real time

Explanation:

Real-time data processing is the execution of data in a short time period, providing near-instantaneous output. The processing is done as the data is inputted, so it needs a continuous stream of input data in order to provide a continuous output.

6 0
3 years ago
The communications standard used to transfer pages on the Web is called _____.
andrezito [222]
Hypertext Transfer Protocol (HTTP)
5 0
3 years ago
Whers the main characteristic of a Peer-to-peer (P2P) network?
ioda

The answer to this would be B

5 0
3 years ago
Other questions:
  • Why isn't my rank move from ambitious to virsto i met all the requirements
    8·2 answers
  • How have search engines like Google, Bing, and Yahoo! revolutionized the ability to do research? They are more difficult to acce
    15·2 answers
  • You are a network administrator for a large bagel manufacturer that has 32 bakeries located throughout the United States, United
    6·1 answer
  • An administrator is writing into a database and received an error detailed in the exhibit. What two steps need to be taken to re
    11·1 answer
  • A user of the wireless network is unable to gain access to the network. The symptoms are:1.) Unable to connect to both internal
    6·1 answer
  • T F A stub is a dummy function that is called instead of the actual function it<br><br> represents.
    7·1 answer
  • Apps are designed by___.
    11·2 answers
  • This logo bby im sorry huhu​
    11·1 answer
  • Caps lock key is used to type alphabets. _________​
    6·2 answers
  • Which bits of the address would be used in the tag, index and offset in a two-way set associative cache with 1-word blocks and a
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!