I have most of the program written, but I just can't seem to remember or know how to make the function add 1 each time for the tally counter. Help will be much appreciated. Thanks!
@BurgerTown: First, what do you think the second part of your "set_vaue" function is doing =)
Second: I do believe that an int will accomplish the purpose of your tallycounter. You can simply ++ to increment it, and you can directly use the << operator to output it to the console =D
And sorry for not understanding it completely, but what exactly do you mean by your second statement? Because I need to have a get_value function. The class also should have a default construct and a constructor to initialize the count and a set_value() function that sets the value to the integer passed to it.
And thanks for the help, its really appreciated and I do want to learn how to do this.
Im trying to create a class that models a tally counter. Like the thing they use a concerts and such that track how many people go through the gates. It needs to display the current value by the class get_value() member function.
The class should have a default construct and a constructor to initialize the count. It should also have a set_value() function that sets the value to the integer passed to it. Thanks for the help tho.
I'm here but I don't understand what your program is supposed to do. Is it supposed to make counter increase by 1 each time the increment() function is called? It looks like your code would do that.
I would expect your programs output to be:
I know it doesn't make much sense, but I think it is suppose to be like one of those things at a concert or stadium that tallies how many people go through the gates. But im not sure how to set it up. Make anymore sense?