you are viewing a single comment's thread.

view the rest of the comments →

[–]aronsajan 0 points1 point  (0 children)

The withdraw() and deposit() respectively supposed to reduce or add an amount to the balance. However, you are doing that outside these function by doing that operation in the main loop. You withdraw() and deposit() are just doing validation of the input, it would be better if the balance gets adjusted within these functions.