Hey guys I need help with this program. I am trying to get a tally counter to work. I believe my main problems are in void clear function and get value function. Any help would be much appreciated on what I could do to make this problem run.
#include <iostream>
usingnamespace std;
class TallyCounter
{
private:
int tally; // private variable used in the class to hold the count
public:
void count(int a)
{
tally=a;
tally++;
} // void function to increments the counter by one
void clear(); // void function to clear the tally to zero
{
tally.clear();
}
int get_value(int counter)
{
return counter; // function to return the current tally value
}
TallyCounter::TallyCounter(); // Constructor
};
int main()
{
TallyCounter tallyObject;
tallyObject.clear();
tallyObject.count();
tallyObject.get_value();
cout<<"Total: "<<get_value();
return 0;
}