All tasks

Loan Interest

Your worst enemy (or frenemy) took out a loan of 20,000 UAH.
Every month, the bank charges 2.5% interest on the amount.

20,000 UAH, 2.5% of the amount

Your frenemy is slowly paying the loan back. But the interest rate goes up every month (the bank that gave the loan turned out to be really evil):

18,000 UAH, 2.5% - 1st month

16,000 UAH, 2.8% - 2nd month

14,000 UAH, 3.1% - 3rd month

12,000 UAH, 3.4% - 4th month

Your task: calculate the total amount and the interest that your frenemy paid.

Loan amount: XXX UAH
Interest paid on the loan: X UAH
Total amount (loan amount + all interest paid): XXX + X UAH

Use functions with parameters in your code.