Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solution(input) {
  2.   let tables = Number(input.shift());
  3.   let tablesLength = Number(input.shift());
  4.   let tablesWidth = Number(input.shift());
  5.  
  6.  
  7.   let coverArea = tables * (tablesLenght + 2 * 0.30) * (tablesWidth + 2 * 0.30);
  8.   let squaresArea = tables * (tablesLenght / 2) * (tablesLength / 2);
  9.  
  10.  
  11.   let priceInDollars = coverArea * 7 + squaresArea * 9;
  12.   let priceInLv = totalInUsd * 1.85;
  13.  
  14.    
  15.     console.log(`${priceInDollars.toFixed(2)} USD`);
  16.     console.log(`${priceInLv.toFixed(2)} BGN `);
  17.  
  18. }
  19.  
  20. solution (["10",
  21.            "1.20",
  22.            "0.65"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement