Advertisement
Liliana797979

clever Lily

Dec 14th, 2020
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function smartLili(arg1, arg2, arg3) {
  2.     let age = Number(arg1);
  3.     let priceWashmashine = Number(arg2);
  4.     let priceToy = Number(arg3);
  5.     let money = 0;
  6.     let totalPrice = ((money + priceWashmashine) - priceToy - 1) * age;
  7.  
  8.     for (i = 1; i <= age; i++) {
  9.         for (j = 0; j <= age; j = 2) {
  10.         }
  11.         if (money >= totalPrice) {
  12.             console.log(`Yes! ${(money - totalPrice).toFixed(2)}`);
  13.         } else {
  14.             console.log(`No! ${(totalPrice - money).toFixed(2)}`);
  15.         }
  16.     }
  17. }
  18.  
  19. smartLili("10", "170", "6");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement