subject

Write a class averagecalculator. the purpose of a averagecalculator object is to count, sum and average a series of numbers. the averagecalculator class has the following specification:

instance variable of type int for the running sum of numbers that have been given to the averagecalculator
instance variable of type int for the count of numbers that have been given to the averagecalculator

no argument constructor
averagecalculator ()

a mutator method to add a number to the averagecalculator
void add(int newnum)

an accessor method to return the sum of all the numbers added to the averagecalculator
int getsum()

an accessor method to return the count, or number, of numbers added to the averagecalculator
int getcount()

an accessor method to return the average of all the numbers added to the averagecalculator
note that the instance variables are int, and the return type of this method is double--be careful with the division operation.
if no numbers have been added to the averagecalculator object, return 0.
double getaverage()

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:40
When the pc version of the spreadsheet program became available, the ibm pc quickly became the top-selling personal computer?
Answers: 3
question
Computers and Technology, 22.06.2019 04:30
Ryan is working on the layout of her web page. she needs to figure out where her header, navigation bar, text, and images should go. what technique can her?
Answers: 1
question
Computers and Technology, 23.06.2019 09:20
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
You know the right answer?
Write a class averagecalculator. the purpose of a averagecalculator object is to count, sum and aver...
Questions
question
English, 12.07.2019 02:30
Questions on the website: 13722363