1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Paladinen [302]
3 years ago
14

Write a class named Accumulator containing: An instance variable named sum of type integer. A constructor that accepts an intege

r parameter, whose value is used to initialize the sum instance variable. A method named getSum that returns the value of sum. A method named add that accepts an integer parameter. The value of sum is increased by the value of the parameter.
Computers and Technology
1 answer:
Genrish500 [490]3 years ago
4 0

Answer:

The following are the code in the C++ Programming Language.

//define header file

#include <iostream>

// using namespace

using namespace std;

//define a class

class Accumulator

{

//set private access modifier

private:  

//declare integer type variable

int sum;

//set public access modifier

public:

//define constructor  

Accumulator (int sum)

{

//refer the same class as instance variable

this->sum = sum;

}

//define integer type function

int getSum()

{

//return the value of sum

return sum;

}

//define void type function

void add (int value)

{

//variable sum is increased by the argument value

sum += value;

}

};

Explanation:

<u>The following are the description of the code</u>.

  • Firstly, set the required header file and namespace then, define a class 'Accumulator' and inside the class.
  • Set private access modifier then, declare an integer data type variable 'sum'.
  • Declare a class constructor whose name is the same as the class name 'Accumulator()' and pass integer data type argument 'sum' in its parameter that refers to the same class as instance variable.
  • Define a integer data type function 'getSum()' that return the value of the variable sum.
  • Finally, define a void type function 'add()' and pass the integer data type argument 'value' in its parameter in which the variable sum is increased by the argument value .
You might be interested in
4. True or False? Electrons flow out from the POSITIVE end of a battery. *<br> True<br> False
lana66690 [7]
False electrons put off a negative charge
4 0
3 years ago
WILL GIVE BRAINLIEST!!!!!!!
pishuonlain [190]

Answer:

False

Explanation:

Central Louisiana Regional Port is the small river port (not in a top 100 ports), while New Orleans Port is  $100 million a year reveniew huge port, 7th busiest in US.

3 0
2 years ago
Drag each tile to the correct box.
garri49 [273]
I think select the video insert select the movie option under illustrations resize the video player then select the insert tab i’m not 100 percent sure tho
8 0
3 years ago
Read 2 more answers
Which tasks can a user accomplish by using the Find and Replace feature of Word? Check all that apply.
sveticcg [70]

Answer:

B,C,E your welcome

Explanation: i just took the test

3 0
2 years ago
You and three of your friends decide to hike the Appalachian Trail, a 2175-mile trail running from Georgia to Maine, starting wh
kozerog [31]

Answer:

The things to do:

a. Lie down flat.

b. Call your friend on phone to inform him of the situation, if he is not already aware.

c. Instruct him to call the rescue team and a helicopter ambulance.

d. Make a video call to your doctor and ask her for first aid instructions.  She can use HIPAA compliant video-conferencing tools to initiate consultations and treatment with you from the far distance.

e. Follow your doctor's instructions.

Explanation:

Telemedicine is the extension of medical services to patients in remote places.  This practise is facilitated by the use of telecommunication devices and telemedical equipment.  Telemedicine is made possible by technological advancements.  Many healthcare practitioners have embraced the practice and offer their patients telemedical services as the need arises.

Modern technology has enabled doctors to consult patients by using HIPAA compliant video-conferencing tools.

HIPAA stands for the Health Insurance Portability and Accountability Act of 1996, which was enacted by the 104th United States Congress and signed by President Bill Clinton in 1996.  The Act encourages Healthcare access to remote patients, medical consultation and treatment portability, and secures health information, among others.

7 0
3 years ago
Other questions:
  • If an improvement creates no significant change in a product’s performance, then it is a(n) ? a0 design improvement.
    6·1 answer
  • Consists of a drive letter (preceded by a drive name when necessary) and colon, to identify the storage device, and one or more
    5·1 answer
  • 33 points!!!!!!!!!!pls help
    15·1 answer
  • rray testGrades contains NUM_VALS test scores. Write a for loop that sets sumExtra to the total extra credit received. Full cred
    5·1 answer
  • A nonprofit organization uses a contact management database to track donations, amounts donated, and all correspondence and phon
    11·1 answer
  • Calculate the ERA
    6·1 answer
  • Yall tryna play gta later? I play on ps4
    12·2 answers
  • Can someone please help me with this ,it is my assignment of technology and agriculture year 8
    5·1 answer
  • How is information processed within a<br> motherboard between the hard drive, CPU and RAM,
    12·1 answer
  • There is overlap in the subjects of study in the different information technology disciplines. true or false
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!