January 2020
Intermediate to advanced
532 pages
13h 31m
English
To begin, we can finish our implementation of the Mortgage sub-module with a real implementation of the payment function.
Let's see how this works:
# Mortgage.jlmodule Mortgagefunction payment(amount, rate, years) monthly_rate = rate / 12.0 factor = (1 + monthly_rate) ^ (years * 12.0) return amount * (monthly_rate * factor / (factor - 1))end end # module
Read now
Unlock full access