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.