Question: Declare variable scoreAndGrade as a HashMap with Character key type and Double value type, representing a grade and the minimum score of the grade. Read

Declare variable scoreAndGrade as a HashMap with Character key type and Double value type, representing a grade and the minimum score of the grade. Read integer numData from input. Then read numData key-value pairs from input and insert each into scoreAndGrade. If the key already exists, do not replace the key's existing value with the new value.
Ex: If the input is:
3 B 80.0 C 69.5 C 70.5
then one possible output is:
Key: C, Value: 69.5 Key: B, Value: 80.0
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!