1. Learn
  2. /
  3. Courses
  4. /
  5. Importing Data in Java

Connected

Exercise

Total compensation calculator

The company needs total compensation figures that combine salary and bonus for each employee. Since this calculation requires values from two different columns in the same row, you'll need to iterate through rows rather than transform a single column.

The Tablesaw library has been imported, and employees.csv contains the Salary and Bonus columns.

Instructions

100 XP
  • Iterate through each row to access both salary and bonus values.
  • Calculate total compensation by summing the two values.
  • Add the totalComp column to the employees table.