APL/APL2.1/TP7/Moyenne/Moyenne.java

14 lines
265 B
Java

public class Moyenne {
int numberOfNumber;
double total;
public Moyenne(){
}
double public getAverage(){
return this.numberOfNumber/this.total;
}
void public add(Number newNumber){
this.numberOfNumber++;
this.total+= newNumber.doubleValue();
}
}