Advertisement
vborislavova

07. Yard Greening - Simple Operations and Calculations

Feb 14th, 2020
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function yardGreening(input) {
  2.     let greeningM2 = Number(input.shift());
  3.     let yardGreening = greeningM2 * 7.61;
  4.     let discount = 0.18 * yardGreening;
  5.     let finalPrice = yardGreening - discount;
  6.  
  7.     console.log(`The final price is: ${finalPrice.toFixed(2)} lv.`);
  8.     console.log(`The discount is: ${discount.toFixed(2)} lv.`);
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement