Second function.

Function to calculate the total interest gained on the loan
(named function type.)