Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function agencyProfit(input) {
- let agency = input[0];
- let ticket = Number(input[1]);
- let kidTicket = Number(input[2]);
- let ticketPrice = Number(input[3]);
- let service = Number(input[4]);
- let totalAdult = (ticketPrice + service) * ticket;
- let totalKid = (0.3 * ticketPrice + service) * kidTicket;
- let total = (totalAdult + totalKid) / 5;
- console.log(`The profit of your agency from ${agency} tickets is ${total.toFixed(2)} lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement