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

14 lines
265 B
Java
Raw Normal View History

2022-03-28 15:12:08 +02:00
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();
}
}