Description
The "Interest is Interesting" currently does not have a test case for task 4 where the target balance has been met by the balance already. If you target savings is 1000, but your balance is already - say - 1200, I would expect the method to return "0": the target has already been met.
I have seen implementations using a do-while loop, which would return 1
at the very least, whereas a while loop would return 0
. Both currently pass as tests.
I would propose to add two test cases: one where the target balance is equal to the balance, and where the target balance is less than the balance. Both of which should return 0
. Furthermore, the instructions should probably clarify that this is expected behaviour (as a hint perhaps?)
Happy to create a PR for this, but wanted to check whether this is indeed the desired behaviour first. This particular task does not appear to be present in other tracks that have the interest-is-interesting exercise, so I did not have any comparison material.