Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function christmasPreparation(input) {
- let paper = 5.80;
- let plat = 7.20;
- let glue = 1.20;
- let paperCount = Number(input[0]);
- let platCount = Number(input[1]);
- let glueLiters = Number(input[2]);
- let discountPercent = Number(input[3]);
- let total = (paperCount * paper) + (platCount * plat) + (glueLiters * glue);
- let discountAmount = (total * discountPercent) / 100;
- total -= discountAmount;
- console.log(total.toFixed(3));
- }
- christmasPreparation(["4",
- "2",
- "5",
- "13"])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement