Question: / * * Average class * / public class Average { private double akkum; private int Count; public Average ( ) / / Constructor; initializes
Average class
public class Average
private double akkum;
private int Count;
public Average Constructor; initializes the class fields
akkum ;
Count ;
public void setSumdouble num Mutator Method Setter
akkum num; This double field is accumulating the values of the numbers entered
public void setCount Mutator Method Setter
Count; This integer counts how many values have been read
public double getSum Accessor Method Getter
return akkum; This double value represents the sum of all the numbers to be averaged
public int getCount Accessor Method Getter
return Count; This integer value represents how many numbers have been entered
public double getAvg Accessor Method Getter
return akkum Count; This double value represents the calculated Average; prevents stale data
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
