Calculating salaries

  • 12
  • Locked
The first parameter of the main method is a file name. Each line of the specified file has the following format: name value where [name] is a String and [value] is a double. [name] and [value] are separated by a space. Find the sum of all the values for each name. Display all the data, sorted by na
You can't complete this task, because you're not signed in.
Comments (2)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 23 , Phoenix, United States
31 January 2020, 20:12
Use a TreeSet and pass a comparator to sort your values :)
Level 41 , São Paulo, Brazil
1 July 2020, 17:34
Using your idea of a TreeSet, I used a TreeMap and it worked as well (with no need of a comparator).