Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easterBakery(input) {
- let flourKg = Number(input.shift());
- let flourPrice = Number(input.shift());
- let sugarKg = Number(input.shift());
- let eggPack = Number(input.shift());
- let yeast = Number(input.shift());
- let flourTotal = flourKg * flourPrice;
- let sugarTotal = flourKg * sugarKg * 0.75;
- let eggPackTotal = flourKg * eggPack * 1.1;
- let yeastTotal = flourKg * 0.75 * yeast * 0.2;
- let sum = flourTotal + sugarTotal + eggPackTotal + yeastTotal;
- console.log(`${sum.toFixed(2)}`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement