ProdanTenev

depositCalculator2

Feb 8th, 2022 (edited)
709
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 0.51 KB | None | 0 0
  1. //сума = депозирана сума  + срок на депозита * ((депозирана сума * годишен лихвен процент ) / 12)
  2.  
  3. function depositCalculator(input) {
  4.     let depositSum = Number(input[0]);
  5.     let depositTime = Number(input[1]);
  6.     let yearPercent = Number(input[2]);
  7.     let interest = depositSum * (yearPercent / 100);
  8.     let interestPerMonth = interest / 12;
  9.     let totalSum = depositSum + (depositTime * interestPerMonth);
  10.     console.log(totalSum);
  11. }
Add Comment
Please, Sign In to add comment