Advertisement
vborislavova

04. Tailoring Workshop - Simple Operations and Calculations

Feb 14th, 2020
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function tailoringWorkshop(input) {
  2.     let tables = Number(input.shift());
  3.     let length = Number(input.shift());
  4.     let width = Number(input.shift());
  5.  
  6.     let tableCloth = tables * (length + 2 * 0.30) * (width + 2 * 0.30);
  7.     let quads = tables * (length/2) * (length/2);
  8.  
  9.     let usd = tableCloth * 7 + quads * 9;
  10.     let bgn = usd * 1.85;
  11.  
  12.     console.log(`${usd.toFixed(2)} USD`);
  13.     console.log(`${bgn.toFixed(2)} BGN`);
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement