Bankrekening

Savings account

In this task, you will simulate a savings account. In a savings account you receive interest every year, depending on the amount of money in your account and the interest rate. Special about this task, however, is that this interest rate can also be negative, that is, you lose money by leaving it in your savings account.

Task

Write a program that reads in a starting capital, the interest rate (negative or positive) and a number of years to simulate. Then show the new savings account balance by year, followed by a summary of the total profit or loss.

Specification

Voorbeeld (positive interest rate)

Below is a sample output of the task. The text in red represents user input and is logically not printed out by your program.

1000.0
0.05
5
Bedrag na 1 jaar: €1050.00.
Bedrag na 2 jaar: €1102.50.
Bedrag na 3 jaar: €1157.63.
Bedrag na 4 jaar: €1215.51.
Bedrag na 5 jaar: €1276.28.
Na 5 jaar bedraagt de winst €276.28.

Example (negative interest rate)

1000.0
-0.01
5
Bedrag na 1 jaar: €990.00.
Bedrag na 2 jaar: €980.10.
Bedrag na 3 jaar: €970.30.
Bedrag na 4 jaar: €960.60.
Bedrag na 5 jaar: €950.99.
Na 5 jaar bedraagt het verlies €49.01.

Remarks and tips