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, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
What is the difference between the internet and the world wide web?
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
Does read theory have answers keys ?
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
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, 27.01.2020 03:31
question
Mathematics, 27.01.2020 03:31
question
Mathematics, 27.01.2020 03:31
Questions on the website: 13722360