While Loop and Return New Value.

I am writing a lottery machine for a class.
I am having trouble figuring out how to return the new value I receive.
If I get an even number I subtract that from the bank.
if I get an odd number I add that to the bank.

The base bank number is 25.
For instance if I get my first random number of 5. I add that to 25 and get 30.
Then if I want another try and get a random number of 2. I subtract that from 30 to get 28.
And so on until I stop the program with character n, or the bank reaches 10 or less.

I have been trying to figure this out on my own, but have not gotten anywhere.

"EDIT: removed code"
Last edited on
Never mind I figured it out.

When I went through the program I got the addition and subtraction I was looking for.

"EDIT: removed code"
Last edited on
Topic archived. No new replies allowed.