Spocoman

03. Deposit Calculator

Nov 30th, 2021 (edited)
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function deposit(input) {
  2.     let deposit = Number(input[0]);
  3.     let months = Number(input[1]);
  4.     let percentage = Number(input[2]);
  5.  
  6.     let total = deposit * months * percentage / 1200 + deposit;
  7.     console.log(total);
  8. }
  9.  
  10.  
  11. РЕШЕНИЕ СЪС SHIFT():
  12.  
  13. function deposit(input) {
  14.     let deposit = Number(input.shift());
  15.     let months = Number(input.shift());
  16.     let percentage = Number(input.shift());
  17.  
  18.     let total = deposit * months * percentage / 1200 + deposit;
  19.     console.log(total);
  20. }
Add Comment
Please, Sign In to add comment