September 2018
Intermediate to advanced
398 pages
9h 43m
English
The implementation for simulatePlan is straightforward; we call futureCapital twice with different arguments:
def simulatePlan(interestRate: Double, nbOfMonthsSaving: Int, nbOfMonthsInRetirement: Int, netIncome: Int, currentExpenses: Int, initialCapital: Double) : (Double, Double) = { val capitalAtRetirement = futureCapital( interestRate = interestRate, nbOfMonths = nbOfMonthsSaving, netIncome = netIncome, currentExpenses = currentExpenses, initialCapital = initialCapital) val capitalAfterDeath = futureCapital( interestRate = interestRate, nbOfMonths = nbOfMonthsInRetirement, netIncome = 0, currentExpenses = currentExpenses, initialCapital = capitalAtRetirement) (capitalAtRetirement, capitalAfterDeath)}
Run RetCalcSpec ...
Read now
Unlock full access