The csv file below stores assessment parameters:
Use Java to do this: Compute Final Grade (the 4th column) value according to the existing 3 columns using the formula Lab Exercise * 30% + Long Quiz * 30% + Alternative Assessment * 40%, and write the result to a new csv file.
T()function parses a csv file or generates a new one. derive() function adds a compute column.
Read How to [Call a SPL Script in Java](T()function parses a csv file or generates a new one. derive() function adds a compute column.
Read How to Call a SPL Script in Java to find how to integrate SPL into a Java application.) to find how to integrate SPL into a Java application.
This is one of the problems on StackOverflow. You can click on it to see that the conventional solution is quite complicated, but the SPL approach is really simple and efficient.
Top comments (0)