The setVar function sets the value of the variable inside the class. Like this:
1 2 3 4
X someObject; // create an object of type X
someObject.setVar(4); // Set the variable variableIwantToChange to 4
someObject.setVar(8); // Set the variable variableIwantToChange to 8
someObject.setVar(-12); // Set the variable variableIwantToChange to -12
So, you have a way to read the variable (getVar) and a way to set the variable. Can you come up with some way that you could read it, and then set it to whatever value you just read plus one?