Didart

Cinema

Apr 2nd, 2022
699
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cinema(input) {
  2.     let type = input[0];
  3.     let rows = Number(input[1]);
  4.     let columns = Number(input[2]);
  5.  
  6.     let income = 0;
  7.     if (type == "Premiere") {
  8.         income = rows * columns * 12.0;
  9.     } else if (type == "Normal") {
  10.         income = rows * columns * 7.50;
  11.     } else if (type == "Discount") {
  12.         income = rows * columns * 5.00;
  13.     }
  14.     console.log(`${income.toFixed(2)} leva`);
  15. }
  16.  
  17. cinema(["Premiere", "10", "12"])
  18.  
Advertisement
Add Comment
Please, Sign In to add comment