Liliana797979

Movie profit

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