#include <iostream>
#include <math.h>
usingnamespace std;
class counterType{
public:
counterType();
int counterPlus();
int counterMinus();
int counterSet(int set_value);
int count;
int countAssign;
};
counterType mycount;
counterType::counterType(){
int count=0;
};
int counterType::counterPlus(void){
count++;
return count;
};
int counterType::counterMinus(void){
count--;
return count;
};
int counterType::counterSet (int set_value)
{
count = set_value;
return count;
}
int main(){
int set_value;
counterType mycount;
int opselect;
int startover;
int count=0;
while(mycount.count>=0);
do{
std::cout<<"please choose from the following options:"<<endl
<<"1. assign a value to count"<<endl
<<"2. add '1' to count"<<endl
<<"3. subtract '1' from count"<<endl;
cin>>opselect;
switch(opselect){
case 1:{
cout << "Please enter a value to set the count to: ";
cin >> set_value;
mycount.counterSet(set_value);
break; };
case 2:{
mycount.counterPlus();
break;};
case 3:{
mycount.counterMinus();
break;};
};
std::cout<<"count is currently:"<<mycount.count<<endl;
std::cout<<"please enter '0' to start over"<<endl;
std::cin>>startover;
}while(startover==0);
};