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. Theconstructor initializes the data members sum and the data member count to 0.A function named getSum that accepts noparameters and returns an integer. getSumreturns 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 theparameter, and increments the value of countby one. A function named getCount that accepts noparameters and returns an integer. getCountreturns the value of the count data member, that is, the number of values added to sum. A function named getAverage that accepts noparameters and returns a double. getAveragereturns 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: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:50
The file sales data.xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel.xlsm to find a nice color of gray.)
Answers: 2
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
question
Computers and Technology, 22.06.2019 22:00
Consider the following declarations (1, 2, 3, 5, 7)class bagtype{public: void set(string, double, double, double, double); void print() const; string getstyle() const; double getprice() const; void get(double, double, double, double); bagtype(); bagtype(string, double, double, double, double); private: string style: double l; double w; double h; double price; }; a.) write the definition of the number function set so that private members are set according to the parametersb.) write the definition of the member function print that prints the values of the data membersc.) write the definition of the default constructor of the class bagtype so that the private member variables are initialized to "", 0.0, 0.0, 0.0, 0.0, respectively d.) write a c++ statement that prints the value of the object newbag.e.) write a c++ statement that declares the object tempbag of type bagtype, and initialize the member variables of tempbag to "backpack", 15, 8, 20 and 49.99, respectively
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
How to launch an app: steps to be successful? launching an app is a great idea, but it’s not that easy as we supposed to think. the majority of mobile applications don’t generate revenue because companies aren’t ready to be competitive. referring to our experience in successfully building and launching apps we hope to you omit these difficulties. we are going to talk about ideas, marketing, testing your product, its development, distribution and support. you will learn 8 product launch stages to succeed.
Answers: 1
You know the right answer?
Write a full class definition for a class named Averager, and containing the following members:An da...
Questions
question
Mathematics, 01.07.2019 12:30
Questions on the website: 13722367