package lab.art; /** * An average operator has an operation that takes two doubles * as arguments and returns their average. * * @author Franck van Breugel */ public class AverageOperator extends BinaryOperator { /** * Initializes this average operator. */ public AverageOperator() { super(); } /** * Returns the average of the given doubles. * * @param a a double. * @param b another double. * @return the average of the given doubles. */ public double operation(double a, double b) { return (a + b) / 2; } }