Advertisement
Spocoman

Christmas Preparation

Jan 4th, 2022
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function christmasPreparation(input) {
  2.    let rollPrice = Number(input[0]) * 5.8;
  3.    let clothPrice = Number(input[1]) * 7.2;
  4.    let gluePrice = Number(input[2]) * 1.2;
  5.    let percentDiscount = Number(input[3]);
  6.    let sum = rollPrice + clothPrice + gluePrice;
  7.    console.log((sum - (sum / 100 * percentDiscount)).toFixed(3));
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement