/ Published in: Java
Expand |
Embed | Plain Text
public class Accumulator { private double total; private int n; public void addDataValue(double val) { total += val; n++; } public double mean() { return total / n; } public void reset() { total = n = 0; } }
You need to login to post a comment.
