Didart

Supplies For School

Mar 4th, 2022
762
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function suppliesForSchool(input) {
  2. let pens =  Number(input[0]);
  3. let markers = Number(input[1]);
  4. let liters = Number(input[2]);
  5. let discount = Number(input[3]);
  6.  
  7. let finalPriceForPens = pens * 5.80;
  8. let finalPriceForMarkers = markers * 7.20;
  9. let finalPriceForLiquid = liters * 1.20;
  10.  
  11. let finalPrice = finalPriceForPens + finalPriceForMarkers + finalPriceForLiquid;
  12.  
  13. let priceWithDiscount = discount / 100;
  14. let total = finalPrice - (finalPrice * priceWithDiscount);
  15.  
  16.     console.log(total);
  17. }
Advertisement
Add Comment
Please, Sign In to add comment