desislava_topuzakova

Untitled

Nov 7th, 2020 (edited)
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. function trainingLab(w, h) {
  2. let lenghtCm = Number(w) * 100;
  3. let widthCm = Number(h) * 100;
  4. let coridorWidth = 100;
  5. let netWidth = widthCm - coridorWidth;
  6. let descWidth = 70;
  7. let descLenght = 120;
  8. let descsOnRow = netWidth / descWidth;
  9. let totalRows = lenghtCm / descLenght;
  10. let totalDescs = Math.floor(descsOnRow) * Math.floor(totalRows);
  11. let takenSpace = 3;
  12. let finalDescs = totalDescs - takenSpace;
  13. console.log(finalDescs.toFixed(0));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment