Define a class for a type called CounterType. An object of this type is used to count things, so it records a count that is a nonnegative whole number, include a default constructor that sets the counter to zero and a constructor with one argument that sets the counter to the value specified by its argument. Include member functions to increase the count by 1 and to decrease the count by 1. Be sure that no member function allows the value of the counter to become negative. Also, include a member function that returns the current count value and one that outputs the count to a stream. The member function for doing output will have one formal parameter of type ostream for the output stream that receives the output. Embed your class definition in a test program
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.