subject

Write a full class definition for a class named averager, and containing the following members: an data member named sum of type integer. an data member named count of type integer. a constructor with no parameters. the constructor initializes the data members sum and the data member count to 0. a function named getsum that accepts no parameters and returns an integer. getsum returns the value of sum. a function named add that accepts an integer parameter and returns no value. add increases the value of sum by the value of the parameter, and increments the value of count by one. a function named getcount that accepts no parameters and returns an integer. getcount returns the value of the count data member, that is, the number of values added to sum. a function named getaverage that accepts no parameters and returns a double. getaverage returns the average of the values added to sum. the value returned should be a value of type double (and therefore you must cast the data members to double prior to performing the division).

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
6. the is particularly susceptible to the effects of alcohol because it receives a large portion of total blood flow and has a high concentration of neurons. a. heart b. pancreas c. brain d. liver
Answers: 2
question
Computers and Technology, 22.06.2019 15:10
David is in week 3 of his current ashford course and has a paper due by monday night at midnight. he has finished everything but the concluding paragraph. as he boots up his computer to work on it, he sees a flash across the screen and then the screen goes black. he begins to panic as he tries desperately to turn the laptop back on. david should have saved his work on what kind of portable device?
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
question
Computers and Technology, 23.06.2019 18:50
Ais a picture icon that is a direct link to a file or folder
Answers: 1
You know the right answer?
Write a full class definition for a class named averager, and containing the following members: an...
Questions
question
Mathematics, 19.03.2021 23:20
question
English, 19.03.2021 23:20
question
Mathematics, 19.03.2021 23:20
question
Physics, 19.03.2021 23:20
question
French, 19.03.2021 23:30
Questions on the website: 13722361