Answer:
Class Counter
{
public Int counter;
public Int limit;
public void increment()
{
If( counter<limit)
{
counter++;
}
}
public void decrement()
{
if (counter>limit)
{
counter--;
}
}
public getvalue()
{
cout<<"Counter Value is:"<<counter;
}
}
Step-by-step explanation:
Class Counter
{
public Int counter;
public Int limit;
public void increment()
{
If( counter<limit)
{
counter++;
}
}
public void decrement()
{
if (counter>limit)
{
counter--;
}
}
public getvalue()
{
cout<<"Counter Value is:"<<counter;
}
}