Bank program help
Now here what I'm asking is if I want to do an "Would you like to do any other missions?" Would I put it inside the if or outside the if?
19 Replies
You mean, if you wanted to go back to the start if the player wants?
If so, then you want a loop
Yeah but would I put it inside the if or outside
And I would use a while loop right?
Yes, a while loop. Or a do..while, so no need for any
if
s
something like this should work
It will loop until the user types quit
when promptedCan you show me the code with a normal while loop not a do while, also what does selection mean
What do you mean "what does selection mean"?
It's just the name of the variable
Ohhh
I DIDNT SEE IT
You can do it with a while loop too, sure
would be one way to do so
It helped thanks
@Angius is there any way I can save progress after I run the program? For example if I deposit 400 and the program ends and I run it again my balance will be 400 is it possible?
Of course, you can just save it to a file
I don't wanna load it to a file just straight out save, something that I can write to the code?
Where do you want to save it if not in a file?
Like maybe a constant?
Something similiar
Every single value in your code gets reset to the default value when the application is closed and ran again
So no way I can do that
You can persist data in a file, in a database (that's also a file)
Dang okay yeah thanks anyways
Mb for taking your time
No problem
$close @Moha
If you have no further questions, please use /close to mark the forum thread as answered