So I’m just starting with C# and I’m encountering a problem where two methods are supposed to affect the same variable (Gasfill) but in practice, only one of them seems to work or when I have gotten them both to work, one seems to overwrite it with their own version of the variable (i.e. the subtracting method keeps subtracting when called and the adding method keeps adding but they aren’t adding or subtracting from each other, only on itself from memory). I thought the issue was that I had them as void methods rather than returning which i thought might relink to the variable outside of the methods, but I’m getting a “method return type is incompatible error” now. Any help?
I’ve attatched an image of both the version where it’s overwriting as well as where it’s encountering the return error.
I’m sure this is really obvious, but could really use some help as a beginner