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, 24.06.2019 01:30
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
Which type of cloud computing offers easily accessible software and applications on the machines
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
What is a number system, and what is the total number of digits used in this system called? a number system is a system that uses different (options: a) numbers b) symbols c) codes d) digits e) alphabets) to represent different numbers. the total number of digits used in a number system is known as its (options: 1) processor 2) converter 3) radix 4) least significant digit 5) most significant digit)
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, 08.12.2020 14:00
question
Chemistry, 08.12.2020 14:00
question
Social Studies, 08.12.2020 14:00