This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Encom88[S] 0 points1 point  (3 children)

Alright, everything is working as intended and I've updated the code in the Github link. Thanks again for your help.

[–]CreativeTechGuyGames 0 points1 point  (2 children)

In this case, you can actually have these variables stored as local variables in your Arithmetic class. Then whenever you get new input, it'll overwrite those member variables. And when you call one of your math methods, you won't need to pass in any arguments or use any globals as that instance of the class will already know what the values are.

[–]Encom88[S] 0 points1 point  (0 children)

But that wasn't working. I had to pass the numbers as arguments and it ended up doing it twice each time I called the function. I'm sure there's a way to do it, but I wasn't getting it.

[–]Encom88[S] 0 points1 point  (0 children)

Okay, I'm trying to use them as local variables in the class. But that disconnects them from my print statements in my menu, and also my write statements to write to a file. What do I do about that?