Advertisement
Guest User

Untitled

a guest
Dec 6th, 2018
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. let balance = +gets();
  2. let interest = (balance / 100) * 5;
  3.  
  4. function roundToTwo(balance) {
  5. return +(Math.round(balance + "e+2") + "e-2");
  6. }
  7.  
  8. balance = roundToTwo(balance + interest);
  9. for (let index = 0; index < 2; index++) {
  10. interest = (balance / 100) * 5;
  11. balance = roundToTwo(balance + interest);
  12. }
  13.  
  14.  
  15. print(balance);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement