- script.js
JavaScript
var calculateDeposit = function () {
};
/* Technical assignment
Meow! I need to calculate how much money I will make on deposits with different terms and conditions. Design the program as calculateDeposit function with four parameters:
1. Initial amount of the deposit;
2. Interest per annum (number from 0 to 100);
3. Term of deposit in months;
4. With capitalization of interest or not (flag with a Boolean value).
The function must return the total amount of the deposit rounded to dollars using Math.round(). Use any parameter names.
If we have a simple deposit, the annual interest is divided by 12 and multiplied by the term of the deposit, and then the initial amount increases by the calculated interest.
Calculating a deposit with capitalization is more difficult: every month the annual interest accrued per month is added to the deposit amount (do not forget to divide the interest by 12), and the interest for the next month is calculated from the increased amount of the deposit.
*/