Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let balance = +gets();
- let interest = (balance / 100) * 5;
- function roundToTwo(balance) {
- return +(Math.round(balance + "e+2") + "e-2");
- }
- balance = roundToTwo(balance + interest);
- for (let index = 0; index < 2; index++) {
- interest = (balance / 100) * 5;
- balance = roundToTwo(balance + interest);
- }
- print(balance);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement