Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function poolDay(input) {
- let partyPeople = Number(input[0]);
- let entryFee = Number(input[1]);
- let sunbedPrice = Number(input[2]);
- let umbrellaPrice = Number(input[3]);
- let entryFeeCosts = entryFee * partyPeople;
- let umbrellaCosts = Math.ceil(partyPeople / 2) * umbrellaPrice;
- let sunbedCosts = Math.ceil(partyPeople * 75 / 100) * sunbedPrice;
- let totalCosts = entryFeeCosts + umbrellaCosts + sunbedCosts;
- console.log(`${totalCosts.toFixed(2)} lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment