Advertisement
marinvch

Heartstone

Apr 15th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve([breakTime, packetPrice, advanturePrice, coffeePrice]) {
  2.     breakTime = Number(breakTime);
  3.     packetPrice = Number(packetPrice);
  4.     advanturePrice = Number(advanturePrice);
  5.     coffeePrice = Number(coffeePrice);
  6.     let timeForPackets = 3 * 2;
  7.     let timeForAdvantures = 2 * 2;
  8.     let coffeTime = 5;
  9.     let packetSpendMoney = packetPrice * 3;
  10.     let adventureSpendMoney = advanturePrice * 2;
  11.  
  12.  
  13.     let totalSpendedMoney = (packetSpendMoney + adventureSpendMoney + coffeePrice);
  14.     let timeLeft = breakTime - (timeForAdvantures + coffeTime + timeForPackets);
  15.  
  16.     console.log(totalSpendedMoney.toFixed(2));
  17.     console.log(timeLeft);
  18. }
  19. solve([40, 16.66, 35, 4.20])
  20. solve([20, 2, 4, 3]);
  21. solve([35, 2.50, 1.2, 6.3]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement