Advertisement
Spocoman

Oscars week in cinema

Feb 26th, 2022
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function oscarsWeekInCinema(input) {
  2.     let movieName = input[0];
  3.     let typeOfHall = input[1];
  4.     let ticketCount = Number(input[2]);
  5.  
  6.     let sum = ticketCount;
  7.  
  8.     if (movieName === "A Star Is Born") {
  9.         if (typeOfHall === "normal") {
  10.             sum *= 7.5;
  11.         } else if (typeOfHall === "luxury") {
  12.             sum *= 10.5;
  13.         } else if (typeOfHall === "ultra luxury") {
  14.             sum *= 13.5;
  15.         }
  16.     } else if (movieName === "Bohemian Rhapsody") {
  17.         if (typeOfHall === "normal") {
  18.             sum *= 7.35;
  19.         } else if (typeOfHall === "luxury") {
  20.             sum *= 9.45;
  21.         } else if (typeOfHall === "ultra luxury") {
  22.             sum *= 12.75;
  23.         }
  24.     } else if (movieName === "Green Book") {
  25.         if (typeOfHall === "normal") {
  26.             sum *= 8.15;
  27.         } else if (typeOfHall === "luxury") {
  28.             sum *= 10.25;
  29.         } else if (typeOfHall === "ultra luxury") {
  30.             sum *= 13.25;
  31.         }
  32.     } else if (movieName === "The Favourite") {
  33.         if (typeOfHall === "normal") {
  34.             sum *= 8.75;
  35.         } else if (typeOfHall === "luxury") {
  36.             sum *= 11.55;
  37.         } else if (typeOfHall === "ultra luxury") {
  38.             sum *= 13.95;
  39.         }
  40.     }
  41.     console.log(`${movieName} -> ${sum.toFixed(2)} lv.`);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement