Question: Declare variable scoreAndNotes as a HashMap with Double key type and String value type, representing a test score and a teacher's comment on the score.

Declare variable scoreAndNotes as a HashMap with Double key type and String value type, representing a test score and a teacher's comment on the score. Read integer dataCount from input. Then read dataCount key-value pairs from input and insert each into scoreAndNotes. If the key already exists, do not replace the key's existing value with the new value.
Ex: If the input is:
397.5 excellent 74.0 good 74.0 satisfactory
then one possible output is:
Key: 74.0, Value: good Key: 97.5, Value: excellent

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!