en.javascript.info/2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator/task.md
Ilya Kantor 4ae129054e up
2017-03-20 21:57:10 +03:00

21 lines
498 B
Markdown

importance: 5
---
# Deposit calculator
Create an interface that allows to enter a sum of bank deposit and percentage, then calculates how much it will be after given periods of time.
Here's the demo:
[iframe src="solution" height="350" border="1"]
Any input change should be processed immediately.
The formula is:
```js
// initial: the initial money sum
// interest: e.g. 0.05 means 5% per year
// years: how many years to wait
let result = Math.round(initial * (1 + interest * years));
```