Advertisement
Liliana797979

moeto viarno reshenie movie profit

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