Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function easterBakery(arg1, arg2, arg3, arg4, arg5) {
- let flourPriceKg = Number(arg1);
- let flourKg = Number(arg2);
- let sugarKg = Number(arg3);
- let eggShellsCount = Number(arg4);
- let yeastPackageCount = Number(arg5);
- let sugarPriceKg = 0.75 * flourPriceKg;
- let eggShellsPriceKg = 0.10 * flourPriceKg;
- let yeastPackagePrice = 0.20 * flourPriceKg;
- let sumFlour = flourKg * flourPriceKg;
- let sumSugar = sugarKg * sugarPriceKg;
- let sumYeast = yeastPackageCount * yeastPackagePrice;
- let sumEggs = eggShellsCount * eggShellsPriceKg;
- let totalSum = sumFlour + sumSugar + sumYeast + sumEggs;
- console.log(totalSum.toFixed(2));
- }
Advertisement
Add Comment
Please, Sign In to add comment