We need a reliable monetary representation for financial operations. Currently, raw double amounts and…
We need a reliable monetary representation for financial operations. Currently, raw double amounts and…: a task in LegoFlow-SWE (Harbor dataset). Addition – addMoney(Money other) - If other has a different currency, throw com.iluwatar.CannotAddTwoCurrienciesException . - Otherwise, add…
The task
**Addition** – `addMoney(Money other)` - If `other` has a different currency, throw `com.iluwatar.CannotAddTwoCurrienciesException`. - Otherwise, add `other.getAmount()` to the current amount and update the stored amount. - Example: Starting with `100.00 USD`, after `addMoney(new Money(50.25, "USD"))` the amount must…
Part of Lego-X/LegoFlow-SWE.