OOP2018 / coinpurse-WorawatCh

coinpurse-WorawatCh created by GitHub Classroom
0 stars 1 forks source link

Logic error in Purse withdraw #11

Closed kykungz closed 6 years ago

kykungz commented 6 years ago

Never ending recursive call to Valuable[] withdraw(Valuable amount).

Valuable[] withdraw(double amount) could just call Valuable[] withdraw(Valuable amount) and let it handle the logic.

Remember:

Withdraw the amount, using only items that have the same currency as the parameter (amount). amount must not be null and amount.getValue() > 0.