Write the interface (.h file) of a class Accumulator containing: A data member named sum of type integer. A constructor accepting an integer parameter. A function named getSum that accepts no parameters and returns an integer. A function named add that accepts an integer parameter and returns no value.
.
.
Click on the title for the solution
.
.
.
Click on the title for the solution
.
.
This is the answer:
:
class Accumulator
{
private:
int sum;
public:
Accumulator(int);
int getSum();
void add(int);
};
Comments
Post a Comment