Tally Counter

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
  
#include <iostream>
using namespace 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;
}
Topic archived. No new replies allowed.