Advertisement
Spocoman

05. Firm

Dec 18th, 2021
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function firm(input) {
  2.     let hour = parseFloat(input[0]);
  3.     let day = parseFloat(input[1]);
  4.     let workers = parseFloat(input[2]);
  5.     let firmHour = Math.floor (day * 8 * 0.9 + (2 * day * workers));
  6.     if (hour > firmHour) {
  7.         console.log(`Not enough time!${Math.floor(hour - firmHour)} hours needed.`);
  8.     }
  9.     else {
  10.         console.log(`Yes!${Math.floor(firmHour - hour)} hours left.`);
  11.     }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement