Question: Declare variable silentAuction as a HashMap with String key type and Integer value type, representing the name and bid of a bidder. Read integer dataCount

Declare variable silentAuction as a HashMap with String key type and Integer value type, representing the name and bid of a bidder. Read integer dataCount from input. Then read dataCount key-value pairs from input and insert each into silentAuction. If the key already exists, do not replace the key's existing value with the new value.
Ex: If the input is:
3 Pat 50 Gil 15 Pat 180
then one possible output is:
Key: Pat, Value: 50 Key: Gil, Value: 15
Note: The order of the keys is not guaranteed in a HashMap.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!