Advertisement
Liliana797979

firm

Dec 7th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function firm(arg1, arg2, arg3) {
  3.     let hours = Number(arg1);
  4.     let days = Number(arg2);
  5.     let employersCount = Number(arg3);
  6.  
  7.     let totalTime = hours * days;
  8.     let hoursEducation = 0.01 * hours;
  9.     let hoursNeeded = hoursEducation * 8;
  10.     let employers = employersCount * (2 * days);
  11.     let totalHours = hoursNeeded + employers;
  12.  
  13.     if (totalTime === "enough") {
  14.         console.log(`Yes!${(totalHours - hoursNeeded).Math.ceil} hours left.`);
  15.     } else {
  16.         console.log(`Not enough time!${(hoursNeeded - totalHours).Math.ceil} hours needed.`);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement