📄 averagearithmetic.java
字号:
package com.lucaslee.report.grouparithmetic;
/**
* 求平均值算法。
* <p>
* Title:
* </p>
* <p>
* Description:
* </p>
* <p>
* Copyright: Copyright (c) 2003
* </p>
* <p>
* Company:Lucas-lee Soft
* </p>
*
* @author Lucas Lee
* @version 1.0
*/
public class AverageArithmetic implements GroupArithmetic {
public AverageArithmetic() {
}
/**
* 参考父类文档。
*
* @param values
* @return
*/
public String getResult(double[] values) {
double result = 0.0;
for (int i = 0; i < values.length; i++) {
result += values[i];
}
return Double.toString(result / values.length);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -