September 2018
Intermediate to advanced
398 pages
9h 43m
English
Now you know how much capital you can expect at your retirement date. It turns out you can reuse the same futureCapital function, to work out how much capital will be left for your heirs.
Add the following test in RetCalcSpec, underneath the previous unit test, and run it. It should pass:
"RetCalc.futureCapital" should { "calculate how much savings will be left after having taken a pension for n months" in { val actual = RetCalc.futureCapital( interestRate = 0.04/12, nbOfMonths = 40 * 12, netIncome = 0, currentExpenses = 2000, initialCapital = 541267.1990) val expected = 309867.53176 actual should ===(expected) }}
So, if you live for 40 years after your retirement date, spend the same amount every ...
Read now
Unlock full access