Advertisement
Liliana797979

cinema

Dec 26th, 2020
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function cinema(input) {
  2.     let index = 0;
  3.     let capacityOfHall = input[0];
  4.     let peopleCount = input[1];
  5.    
  6.     while (capacityOfHall !== "Movie time!") {
  7.         if (capacityOfHall === peopleCount) {
  8.             capacityIsHall = true;
  9.             break;
  10.         }
  11.         index++;
  12.         capacityIsHall = input[index];
  13.     }
  14.         if (capacityIsHall === "Movie time!") {
  15.             console.log(`There are {останали места} seats left in the cinema.`);
  16.         } else if (capacityOfHall == capacityIsHall) {
  17.             console.log(`The cinema is full.`);
  18.         } else {
  19.             console.log(`Cinema income - ${totalProfit} lv.`);
  20.        
  21.         }  
  22. }
  23.  
  24. cinema([60, 10, 6, 3, 20, 15, "Movietime!"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement