Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function agencyProfit(input) {
- let company = input[0];
- let adultTickets = Number(input[1]);
- let kidsTickets = Number(input[2]);;
- let adultPrice = Number(input[3]);
- let fee = Number(input[4]);
- let kidPrice = adultPrice * 0.30;
- let soldTickets = (adultTickets * adultPrice + adultTickets * fee) + kidsTickets * kidPrice + kidsTickets * fee;
- let profit = soldTickets * 0.20;
- console.log(`The profit of your agency from ${company} tickets is ${(profit).toFixed(2)} lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment