Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function movieProfit(input) {
- let movieName = input[0];
- let daysCount = Number(input[1]);
- let ticketsCount = Number(input[2]);
- let ticketPrice = Number(input[3]);
- let percent = Number(input[4]);
- let sumTicketsForDay = ticketsCount * ticketPrice;
- let profit = daysCount * sumTicketsForDay;
- let price = percent * profit / 100;
- let totalProfit = profit - price;
- console.log(`The profit from the movie ${movieName} is ${totalProfit.toFixed(2)} lv.`);
- }
- movieProfit(["The Programmer", "20", "500", "7.50", "7"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement