18 - Building a bank deposit simulator from scratch (Math.round) (JS lessons)
📘 Task: Bank Deposit Calculator
Create an application "Deposit Calculator".
The user enters the deposit amount, selects the number of months,
and optionally enables a bonus.
After clicking the Calculate button, you need to:
- Calculate the final deposit amount
- Display the initial amount (Start)
- Display the final amount (Result)
- Adjust the height of the bars based on the result
📐 Use the formula:
-
Final amount:
result = money × (1 + 0.01 × months)
📌 If the +200 bonus checkbox is enabled:
🧪 Examples:
- 10000 for 3 months → 10300
- 10000 for 6 months → 10600
- 10000 for 6 months + bonus → 10800
📊 Visualization:
- Start bar — fixed height (100px)
- Result bar — increases depending on the number of months
📌 Important:
All calculations must be done in JavaScript.
Do not modify HTML or CSS.